Exemple #1
0
function display_page_content()
{
    //$images = Images::FindAll();
    ?>
	
	<script type="text/javascript">
		$().ready(function() {
			
			// This is in the admin template, but not in THIS dom...
			$(".droplink").click(function() {
				$("#opendropslides .dropslide").each(function() {
					$(this).slideUp('fast');
				});
				var link = $(this).attr('title');
				$('#'+link).slideDown('fast');
			});
			
			$('#description_add').click(function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/custom_html/true', function() { 
					$("#custom_text_removed").slideUp(0);
					$("#custom_text_added").slideDown();
				});
				return false;
			});
			
			$('#description_remove').click(function() {
				$('#session_add').load('<?php 
    echo BASEHREF;
    ?>
blaster/session_add/custom_html/false', function() { 
					$("#custom_text_added").slideUp(0);
					$("#custom_text_removed").slideDown();
				});
				return false;
			});
		});
	</script>
	
	<p><label for="name">Custom Text:</label> <span class="red">Be sure to click &ldquo;Add Text&rdquo; below to make this option active. Your text will not be added unless the button has been clicked. </span><br />
    	<textarea name="description" id="description" rows="24" style="width: 98%"></textarea>
	</p>
	
	<p><a href="#insert" class="droplink" title="img_insert">Insert Image</a>
	<a href="#insert" class="droplink" title="doc_insert">Insert Documents</a>
	<a href="#insert" class="droplink">(hide)</a></p>
	<div id="opendropslides">
	<?php 
    require_once snippetPath("admin-insertImage");
    require_once snippetPath("admin-insertDoc");
    ?>
	</div>
	
	<p><a href="#" id="description_add" class="submitbutton smaller">Add Custom HTML</a>&nbsp; &nbsp;
	<a href="#" id="description_remove" class="submitbutton smaller">Remove Custom HTML</a></p>
	
	<div id="custom_text_added" class="blast_notice" style="display: none;">Custom Text Added <small>(to remove, use the button above)</small></div>
	<div id="custom_text_removed" class="blast_notice" style="display: none;">Custom Text Removed</div>
	
	<?php 
}
Exemple #2
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 
}
Exemple #3
0
function display_page_content()
{
    ?>

	<script type="text/javascript">
		//<![CDATA[
	    loadTinyMce("category_content");
		
		$().ready(function() {
			
			$("#category").validate({
				rules: {
						display_name: "required",
					},
				messages: {
						display_name: "Please enter a display name for this category",
					}
			});
		});
		//]]>
	</script>
	
	<div id="edit-header" class="categorynav">
		<h1>Add a Category</h1>
	</div>
	
	<form method="POST" id="add_blog">
		<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 display name of the category; how it will display in navigation.</span><br />
			<?php 
    textField("display_name", "", "required: true");
    ?>
		</p>
		
		<p>
			<label for="category_content">Content (optional &ndash; not all templates may display this content):</label><br />
			<?php 
    textArea("category_content", "", 98, EDIT_WINDOW_HEIGHT);
    ?>
		</p>
		
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
					
		
		<div id="edit-footer" class="categorynav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Add Category" /> <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 
}
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 
}
Exemple #5
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 
}
Exemple #6
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 
}
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 
}
Exemple #8
0
function include_snippet($snippet)
{
    require_once snippetPath($snippet);
}
    }
    SUB_PAGES ? require_once snippetPath("admin-area_child") : (require_once snippetPath("admin-area"));
    echo "\t</div>\n";
}
$documents = Documents::FindAll();
require_once snippetPath("admin-insertDoc");
$images = Images::FindAll();
require_once snippetPath("admin-insertImage");
if (GALLERY_INSTALL && !in_array(getRequestVarAtIndex(1), $portfolio)) {
    $galleries = Galleries::FindAll("DESC");
    require_once snippetPath("admin-insertGallery");
}
if (PORTFOLIO_INSTALL && (ITEM_GALLERY_INSERT && !in_array(getRequestVarAtIndex(1), $portfolio))) {
    //$galleries = Galleries::FindAll();
    require_once snippetPath("admin-insertItemGallery");
}
if (VIDEO_INSTALL) {
    require_once snippetPath("admin-insertVideo");
}
if (TESTIMONIAL_INSTALL) {
    require_once snippetPath("admin-insertTestimonial");
}
if (PRODUCT_INSTALL) {
    $products = Product::FindAll();
    require_once snippetPath("admin-insertProduct");
}
?>
								
	<div class="clearleft"></div>
</div>
<!-- End Insertables -->
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 
}
Exemple #11
0
function display_page_content()
{
    // Set all values to null by default
    $entry = $entrytitle = $entrypublic = $entrydate = $entryimage = $entrycontent = $entryexcerpt = $entryauthor = $entrytemplate = $preventry = $nextentry = null;
    // Get values from existing object if this is not the Add page
    if (requestIdParam() != 'add') {
        $entry_id = requestIdParam();
        $entry = Blog_Entries::FindById($entry_id);
        $entrytitle = $entry->title;
        $entrypublic = $entry->public;
        $entrydate = $entry->getDateStart();
        if (BLOG_ENTRY_IMAGES) {
            $possibleimage = $entry->getImage();
            if (is_object($possibleimage)) {
                $entryimage = $possibleimage;
            }
        }
        $entrycontent = $entry->content;
        $entryexcerpt = $entry->excerpt;
        $entryauthor = $entry->author_id;
        $entrytemplate = $entry->template;
    }
    // Get other needed objects
    $the_blog = Blogs::FindById(BLOG_DEFAULT_ID);
    $authors = Users::FindAll();
    $categories = Categories::FindAll();
    $thisuser = Users::GetCurrentUser();
    // Get Previous and Next links
    if (is_object($entry)) {
        $preventry = $the_blog->getPrevEntry($entry->date, false);
        $nextentry = $the_blog->getNextEntry($entry->date, false);
    }
    // Warning thrown
    // Double check that the proper columns exist
    $photo_entry_id = find_db_column('photos', 'entry_id');
    if (!$photo_entry_id) {
        echo '<h2 class="system-warning"><span>HCd&gt;CMS says:</span> The Photos table does not have a column called "entry_id"</h2>';
    }
    // Language for the header
    if (is_object($entry)) {
        $header = 'Edit ' . ucwords(BLOG_STATIC_AREA) . ' Entry :: <a href="' . get_link(BLOG_STATIC_AREA . "/view/" . $entry->id . "/" . slug($entry->title)) . '" title="Click to View this Entry (save it first!)">View Entry</a>';
    } else {
        $header = 'Create new ' . ucwords(BLOG_STATIC_AREA) . ' Entry';
    }
    ?>

	<div id="edit-header" class="entrynav threecolumnnav">
		<div class="nav-left column">
			<h1><?php 
    echo $header;
    ?>
</h1>
		</div>
		<div class="nav-center column">
			<?php 
    if (!empty($preventry)) {
        ?>
<a href="<?php 
        echo get_link("/admin/edit_entry/" . $preventry->id);
        ?>
" title="<?php 
        $preventry->the_title();
        ?>
">&larr; Previous Entry</a><?php 
    }
    ?>
		</div>
		<div class="nav-right column">
			<?php 
    if (!empty($nextentry)) {
        ?>
<a href="<?php 
        echo get_link("/admin/edit_entry/" . $nextentry->id);
        ?>
" title="<?php 
        $nextentry->the_title();
        ?>
">Next Entry &rarr;</a><?php 
    }
    ?>
			
		</div>
		<div class="clearleft"></div>
	</div>
	
	<form method="POST" id="edit_entry" 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">Title:</label>
			<span class="hint">This is the Title of the entry; how it will display in the navigation.</span><br />
			<?php 
    textField("title", $entrytitle, "required: true");
    ?>
		</p>
		
		<div id="entry_date" class="column half">
			
			<p><label for="public">Public: <input type="checkbox" name="public" id="public" <?php 
    if ($entrypublic) {
        ?>
checked="checked"<?php 
    }
    ?>
></label> &nbsp; <span class="hint">Visible or not visible to the public? If you are working on an entry that is not yet ready, leave this off until it is complete. </span></p>
			
			<p>
				<label for="date">Entry Date: </label>
				<input type="text" name="date" id="date" value="<?php 
    echo $entrydate;
    ?>
" />
			</p>
        
        <?php 
    if (!BLOG_ENTRY_IMAGES) {
        ?>
		</div>
		<div class="column half last">
		<?php 
    }
    ?>
        
			<p>
				<label for="author_id">Author:</label> &nbsp; 
				<select name="author_id" id="author_id">
				<?php 
    foreach ($authors as $theauthor) {
        $selected = $theauthor->id == $entryauthor ? ' selected="selected"' : '';
        echo "<option value=\"{$theauthor->id}\"{$selected}> " . $theauthor->get_username() . " </option>\r\n";
    }
    ?>
				
				</select>
			</p>
			
			<?php 
    if (BLOG_ENTRY_TEMPLATES) {
        ?>
			<p>
    			<label for="template">Template:</label>
    			<select id="template" name="template">
    				<?php 
        require_once snippetPath("blog_templates_array");
        foreach ($blog_templates as $template) {
            echo '<option value="' . $template . '"';
            if ($template == $entrytemplate) {
                echo ' selected="selected"';
            }
            echo '>' . $template . '</option>';
        }
        ?>
    				
    			</select>
    		</p>
    		<?php 
    }
    ?>

        <?php 
    if (BLOG_ENTRY_IMAGES) {
        ?>
		</div>
		<div id="entry-thumb" class="column half last">
			
			<!-- Entry image -->
            <div style="padding-bottom: 1em;">
                <p><label for="entry_image"><?php 
        echo empty($entryimage) ? 'Add' : 'Edit';
        ?>
 an Entry Image:</label>
    				<input type="file" name="entry_image" id="entry_image" value="" />
    			</p>
    			<p class="hint">An image may be used by your site design on landing pages or menus. </p>
			<?php 
        if (!empty($entryimage)) {
            echo '<h3>Existing Entry Image (reduced in size)</h3>';
            echo '<p><img src="' . $entryimage->getPublicUrl() . '" style="max-width:100%;" alt=""></p>';
        }
        echo '</div>';
    }
    // end if BLOG_ENTRY_IMAGES
    ?>

		</div>
		
		<p class="clearleft">
			<label for="entry_content">Content:</label><br />
			<?php 
    textArea("entry_content", $entrycontent, 98, EDIT_WINDOW_HEIGHT / 2);
    ?>
		</p>
		
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
		
		<ul id="gallery-options-nav" class="menu tabs">
			<li><a href="#section_selector" class="openclose opened">Edit Categories for this Entry</a></li>
		</ul>
		<div id="section_selector" class="dropslide">
			<h2><legend>Select a Category to include this Entry in:</legend></h2>
			<fieldset>
				<p>
			<?php 
    $entrycats = is_object($entry) ? $entry->getCategories() : false;
    foreach ($categories as $thecategory) {
        $checked = "";
        if ($entrycats) {
            foreach ($entrycats as $entry_cat) {
                if ($thecategory->id == $entry_cat->id) {
                    $checked = ' checked="checked"';
                }
            }
        }
        echo '<label for="' . slug($thecategory->display_name) . '">' . $thecategory->display_name . '&nbsp;';
        echo '<input name="selected_cats[]" id="' . slug($thecategory->display_name) . '" class="boxes"' . $checked . ' type="checkbox" value="' . $thecategory->id . '" /></label>';
    }
    ?>
				
				</p>					
				<p><span class="hint">Any entry can be in more than one Category. If no categories are selected, this entry will be categorized in the default &ldquo;Uncategorized&rdquo; category.</span></p>
			</fieldset>
		</div><!-- #section_selector -->
        
        
        <p class="clearleft">
			<label for="entry_excerpt">Excerpt:</label><br />
			<?php 
    textArea("entry_excerpt", $entryexcerpt, 98, EDIT_WINDOW_HEIGHT / 3);
    ?>
			<p><span class="hint"><i>Optional:</i> An excerpt is commonly used on landing pages or in special areas, like the meta (SEO) description. Keep it short and limit the use of HTML.</span></p>
		</p>
		
		
		<div id="edit-footer" class="entrynav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Entry"> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List">
				</p>
				
			</div>
			<div class="column half last">
			
				<p>
				<?php 
    if (is_object($entry)) {
        ?>
					<label for="delete">Delete this entry?</label>
					<input name="delete" class="boxes" type="checkbox" value='<?php 
        echo $entry->id;
        ?>
' />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this entry from the database</span>
				<?php 
    } else {
        echo '&nbsp;';
    }
    ?>
				</p>
			
			</div>
		</div>
		
	</form>
	
	<script type="text/javascript">
	    var entrydate;
		
		$().ready(function() {
			
			$( "#date" ).datetimepicker({
    			showButtonPanel: true,
    			showOtherMonths: true,
    			selectOtherMonths: true,
    			timeFormat: 'hh:mm:ss tt',
    			stepMinute: 5
    		});

			$("#edit_entry").validate({
				rules: {
					title: "required",
				},
				messages: {
					title: "Please enter a title for this <?php 
    echo BLOG_STATIC_AREA;
    ?>
 entry",
				}
			});
		});
	</script>
	
<?php 
}
function display_page_content()
{
    $area_id = requestIdParam();
    $area = Areas::FindById($area_id);
    $user = Users::GetCurrentUser();
    ?>

	<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>Edit Portfolio Area : <a href="<?php 
    $area->the_url();
    ?>
" title="View <?php 
    $area->the_url();
    ?>
">View Area</a></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>
			<input type="text" name="display_name" value="<?php 
    echo $area->display_name;
    ?>
" class="required: true" /><br />
			<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 (for SEO):</label>
			<?php 
    textField("seo_title", $area->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>
		
		<div id="public" class="column half">
			<p>
				<label for="public">Public:</label>&nbsp; <?php 
    checkBoxField("public", $area->public);
    ?>
<br />
				<span class="hint">This determines whether or not the Portfolio Area will appear in the navigation as a &ldquo;Public&rdquo; link. If this Portfolio Area is not public, then no sections within it &ndash; Public or not &ndash; will be visible. A nice way to create a new Portfolio Area is to make the Portfolio Area NOT Public, and all the sections within it Public, so one click can turn it all on when it is ready. </span>
			</p>
		
		</div>
		<div id="template" class="column half">
			<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}\"";
        if ($template == $area->template) {
            echo " selected=\"selected\"";
        }
        echo ">{$text}</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>
		<div class="clearleft"></div>
		
		<p><label for="area_content">Portfolio Area Description (optional):</label>
			<?php 
    textArea("area_content", $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="Edit Area" /> <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($area->id, explode(",", PROTECTED_ADMIN_AREAS))) {
        ?>
				
				<p><label for="delete">Delete this Area? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $area->id;
        ?>
"></label>
				<span class="hint">Check the box and click &ldquo;Edit&rdquo; to delete from the database. Any sections or items contained within will become orphans and will be shown in the list for reassignment.</span></p>
			<?php 
    } else {
        ?>
		
				<p>This area is being protected, it can not be deleted.</p>
			<?php 
    }
    ?>
			
			</div>
		</div>
		
	</form>
<?php 
}
function display_page_content()
{
    $section_id = requestIdParam();
    $section = Sections::FindById($section_id);
    $user = Users::GetCurrentUser();
    // get all the areas
    $areas = Areas::FindPortAreas();
    //$page_areas = array();
    if (is_object($section)) {
        $page_areas = $section->getPortfolioAreas();
    }
    ?>

	<script type="text/javascript">
		loadTinyMce('section_content');
		$().ready(function() {
			errorLabelContainer: $("#error_container"),
			
<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
					
			$("#edit_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 {
        ?>
					
			$("#edit_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>
	
	<div id="edit-header" class="sectionnav">
		<h1>Edit Portfolio Section : <a href="<?php 
    $section->the_url();
    ?>
" title="View <?php 
    $section->the_url();
    ?>
">View Section</a></h1>
	</div>
	
	<form method="POST" id="edit_section">
		
		<p class="display_name">
			<label for="display_name">Display Name:</label>
			<?php 
    textField("display_name", $section->display_name, "required: true");
    ?>
<br />
			<span class="hint">This is the Proper Name of the section; how it will display in the navigation.</span>
		</p>
		
		<?php 
    if (ALLOW_SHORT_PAGE_NAMES) {
        ?>
					
		<p>
			<label for="name">Name</label>
			<?php 
        textField("name", $section->name, "required: true");
        ?>
<br />
			<span class="hint">This is the short name of the page 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}\"";
            if ($template == $section->template) {
                echo " selected=\"selected\"";
            }
            echo ">{$text}</option>";
        }
        ?>
			
			</select></p>
	<?php 
    } else {
        hiddenField("template", $section->template);
    }
    ?>
		
		<p>
			<label for="public">Public:</label> <?php 
    checkBoxField("public", $section->public);
    ?>
		</p>
		
		<p>
			<label for="content">Section Description:</label>
			<?php 
    textArea("section_content", $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="Edit Section" /> <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 section? <input name="delete" id="de;ete" class="boxes" type="checkbox" value="<?php 
        echo $section->id;
        ?>
"></label>
				<span class="hint">Check the box and click &ldquo;Edit&rdquo; to delete from the database</span></p>
			<?php 
    }
    ?>
			
			</div>
		</div>
		
	</form>
<?php 
}
Exemple #14
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 
}
Exemple #15
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 
}
Exemple #16
0
function display_page_content()
{
    ?>
    
    <div id="edit-header" class="dashboard">
		<h1>Dashboard: Definitions and Recent Activity</h1>
	</div>
    
	<style type="text/css">
	<!--
	.dropslide { background-color: transparent; }
	blockquote { padding: 10px 10px 0 10px; margin: 0 0 10px 0; border: 1px solid #ccc; }
	ul.list { list-style: disc; padding: 0 0 0 15px; margin: -8px 0 10px 0; }
	blockquote blockquote { 
		border: 1px solid #ccc; 
		padding: 5px 5px 0 5px; 
		background-color: #eee; 
		margin: 0 0 10px 20px; 
	}
	-->
	</style>
	
	<ul id="dashboard" class="tabs menu">
		<li><a href="#welcome" class="openclose opened">Welcome</a></li>
		<li><a href="#general" class="openclose">General Features</a></li>
		<li><a href="#navdescript" class="openclose">The Navigation</a></li>
		<li><a href="#glossary" class="openclose">Glossary</a></li>
		<li><a href="#custom" class="openclose">Custom</a></li>
	</ul>
	
	<div id="welcome" class="dropslide">
		<h1>Welcome</h1>
		<p>Welcome to your content management system, the HCd&gt;CMS. This system allows access to the text and image content of your website. Choose a tab above for a description of each concept, what it does, and how to use it. Or, choose an action below or from the navigation to the right to get started. </p>
	</div>
	
	<div id="general" class="dropslide" style="display:none;">
		<h2>Areas and Pages</h2>
		<p>The core of the HCd&gt;CMS is the management of Areas and Pages. Areas are containers for pages, and pages are independent objects that can be placed inside more than one area. A page has content, or a description, whereas an Area has only a name.</p>
		<p>The order in which Areas and Pages appear when viewing <a href="<?php 
    echo get_link("admin/list_pages");
    ?>
">List Pages</a> is the order in which they will appear on the site, either right to left in a horizontal navigation or top to bottom in a vertical navigation. They may be reordered by dragging a dropping them into place. </p>
		
		<h2>Email addresses</h2>
		<p><strong>Email addresses in Page Content do not need to be coded.</strong> When the database sees an email address (.com, .net, .org, .biz, .info, etc...) it will encode and hide the email from spam robots, but make it an active link for browsers with Javascript turned on. There is no need to manually make email addresses a link. </p>
		
		<h2 class="red">Success or Failure Feedback:</h2>
		<p>When a page has been successfully executed, a red message will appear above the page content. If there is a failure, error, or a required field was not filled out, a message will appear below or above the problem field. </p>
		
		<h2>Public vs. Not Public</h2>
		<p>Areas, pages, sections, items, blog posts and events all have the ability to be Public or non-public. Simply stated, public means that the page or item will be available to users on the front-end, while non-public is hidden from view and available only to those who have access to this admin portion of the website.</p>
		<p>Public-ness can be inherited, though. An Area can be not public, while all of its Pages are public. As long as those pages do not appear in any other Area, those pages will only be public once the Area is public. Same thing follows for Portfolio Areas and Sections &ndash; children of containers inherit the parent&rsquo;s public property. In this way, it is possible to launch a whole new section of content at one time. </p>
	</div>
	
	<div id="navdescript" class="dropslide" style="display:none;">
		<h2>The Navigation (to the Right):</h2>
		<p>The navigation is broken into three Main Areas. Here is what to expect in each:</a></p>
		
		<h2>Manage Content</h2>
		<p>&ldquo;Content&rdquo; is most of your site. In this section, you will be able to manage Pages, Calendar Content, Blog Content, or E-Newsletters. Options may vary slightly from one installation to another, and may contain custom options as well.</p>
		<p><strong class="red">Pages</strong> = <em>Edit Existing Pages</em> displays all the pages from the database in a table, organized by what Area they are contained within. Pages that are not in a specific area will show up in the Global area. From here you can choose a page to edit, or change the order in which they are displayed. The order is top-down &ndash; in other words, the first page listed will also be first in the navigation, wheteher your navigation is right to left or top down. <em>Add a Page, Add an Area</em> = These links to create new pages or areas and add them to the database.</p>
		<?php 
    if (BLOG_INSTALL) {
        ?>

		<p><strong class="red">Blog</strong> = <em>Edit Blog Entries</em> displays a date-organized list of past blog entries. Click an entry name to edit it. You may also change the date of an older entry. <em>Add Blog Entry</em> creates a new entry in the database, which you may date as the day it was created or post-date. To edit the &ldquo;name&rdquo; of the Blog, you can edit the name of the Area that represents the blog in the navigation.</p>
		<?php 
    }
    ?>
		<?php 
    if (PORTFOLIO_INSTALL) {
        ?>

		<p><strong class="red">Portfolio</strong> = <em>Edit Portfolio Sections and Items</em> displays a list of all the Items, organized by Sections and Portfolio Areas. The display order is top-down, and areas, sections and items are all click-and-draggable. Click on any name to edit that entry, whether it be the name of a Portfolio Area, the Name and Description of a Section, or the Name, Description and Image Gallery for an Item. </p>
		<?php 
    }
    ?>
		<?php 
    if (CALENDAR_INSTALL) {
        ?>

		<p><strong class="red">Calendar</strong> = <em>Edit Existing Events</em> displays a calendar-formatted list of all the Events in the database. Click an event to edit it, or, use the arrows (to the right and left of the name of the month) to go forward or backward in time. <em>Add a new Event</em> creates an event in the database. <em>Edit Event Types</em> lists the current event types in the database. Click on the name to edit it. An event type is simply a way to organize events for your calendar. You can have as many event types as you like, and customize the colors that they are represented with. Click <em>Add a New Event Type</em> to create a new one.</p>
		<?php 
    }
    ?>
		
		<h2>Manage Extras</h2>
		<p>&ldquo;Extras&rdquo; are objects that are separate from page content &ndash; by this, we mean things like Images, Documents, Products, Galleries and Videos. They can be inserted into content, but may not be accesible on their own. So we manage them here. </p>
		<p><strong class="red">Images</strong> = <em>Edit Existing Images</em> displays images in a grid by thumbnail and name, listed by the newest image first. Click any thumbnail to edit the image&rsquo;s properties. Click <em>Upload a New Image</em> to add more to the database. </p>
		<blockquote>
			<p><strong>Insert Image tags=</strong> <em>what they look like and what they do:</em></p>
			<ul class="list">
				<li>{{name_of_image{{ :: An image name surrounded by double curly braces. In this case, because they both point left, the image will be floated left. </li>
				<li>}}name_of_image}} :: Both braces point right, therefore the image will be floated right. </li>
				<li>{{name_of_image}} :: Braces point in opposing directions, therefore the image will be centered in the content column and text will <em>not</em> be allowed to flow around it. </li>
			</ul>
		</blockquote>
		
		<p><strong class="red">Documents</strong> = <em>Edit Existing Documents</em> lists documents by name, from newest to oldest. Click any document name to edit the document&rsquo;s properties, or click &ldquo;view&rdquo; to download a copy of that document. Click <em>Upload a New Document</em> to add more to the database. </p>
		<blockquote>
			<p><strong>Insert Document tags=</strong> <em>what they look like and what they do:</em></p>
			<ul class="list">
				<li>{{document:name_of_document{{ :: This is what all tags look like. What they insert ends up looking like this on the front-end= &ldquo;<a href="#">name_of_document</a> (pdf)&ldquo; or whatever type the document may be. </li>
			</ul>
		</blockquote>
		<?php 
    if (GALLERY_INSTALL) {
        ?>

		<p><strong class="red">Galleries</strong> = <em>Edit Existing Galleries</em> displays a list of Galleries by thumbnail and name. Click any gallery name or image to edit the name, add photos, change the order of photos, edit captions, or delete images. Click <em>Add a New Gallery</em> to add a new name to the database, and then click the name in the <em>Edit Existing</em> list to add photos to it. </p>
		<blockquote>
			<p><strong>Insert Gallery tags=</strong> <em>what they look like and what they do:</em></p>
			<ul class="list">
				<li>{{gallery:name_of_gallery{{, }}gallery:name_of_gallery}}, {{gallery:name_of_gallery}} :: Gallery tags follow the same pattern as image tags. The thumbnail (the first image in the gallery) will be displayed either left, right, or centered above text. If a gallery is centered, it will normally appear larger on the page than if it was floating left or right.  </li>
				<li>{{carousel:name_of_gallery{{ :: In addition, most installs of the HCd&gt;CMS support auto-playing carousels. Try replacing the word &ldquo;gallery&rdquo; in the tag with &ldquo;carousel&rdquo; to see what happens. </li>
				<li>{{random-from-gallery:name_of_gallery{{ :: As the name suggests, this code will randomly select one image from a gallery of images and display it on the page. The curly braces will denote the placement or &ldquo;float&rdquo; of the image.</li>
			</ul>
		</blockquote>
		<?php 
    }
    ?>
		<?php 
    if (VIDEO_INSTALL) {
        ?>
		<p><strong class="red">Videos</strong> = <em>Edit Existing Videos</em> displays a list of videos available in the database. Click on any video name to edit the video&rsquo;s properties, including title, unique ID, hosting service, width and height. Click <em>Add a New Video</em> to add more to the database. </p>
		<?php 
    }
    ?>
		<?php 
    if (PRODUCT_INSTALL) {
        ?>

		<p><strong class="red">Products</strong> = <em>Edit Existing Products</em> displays a list of Products in the database. Click any product name to edit the product&rsquo;s properties, including price, thumbnail image, and description. Click <em>Add a New Product</em> to add more to the database. </p>
		<?php 
    }
    ?>
		
		<h2>Admin Controls</h2>
		<p>&ldquo;Admin&rdquo; users have ultimate control over the site, and can manage the level of access that other users have as well. This section holds some of the controls that advanced users may have. </p>
		<?php 
    if (PRODUCT_INSTALL) {
        ?>

		<p><strong class="red">PayPal</strong> = If your site has Products installed (Manage Extras &gt; Products), then this is where you may edit the information for your PayPal account. Your site may have at least one account, but could have more. <em>Edit Accounts</em> is where these will be listed &ndash; click a name to edit it.</p>
		<?php 
    }
    ?>
		
		<p><strong class="red">Users</strong> = For any site, users can be Admins (click the box marked &ldquo;Admin?&rdquo;) or they may be just regular users. The difference is that &ldquo;Admins&rdquo; have ultimate control over content &ndash; &ldquo;Admins&rdquo; can delete pages, areas, blog entries, etc... &ldquo;Admins&rdquo; can also create, edit and delete users as well as edit PayPal accounts. Regular users (&ldquo;non-admins&rdquo;) can only edit page, event, or blog content, and upload and edit images, documents or galleries. They can not delete content.</p>
	
	</div>
	
	<div id="glossary" class="dropslide" style="display:none;">
		<h2>Glossary:</h2>
		<dl>
			<dt>Areas</dt>
			<dd>An Area in the HCd&gt;CMS is a grouping of pages &ndash; it is not a page itself, but a way to organize pages into specific groups of content. </dd>
			
			<dt>Global Area</dt>
			<dd>When we say &ldquo;Global Area&rdquo;, or &ldquo;Global Page&rdquo;, that means that it is the first page people see before a choice is made to navigate somewhere else (a home page, or the first page of an &ldquo;area&rdquo;). Sometimes pages that do not have a home of their own will exist in the &ldquo;Global&rdquo; area. </dd>
			
			<dt>Pages</dt>
			<dd>A page exists in the database with specific content. Pages can get added to one or more areas, or be global. </dd>
			
			<dt>Orphans</dt>
			<dd>Any child element without a parent &ndash; A Page without an Area, a Section without an Area, or an Item without a Section.</dd>
		<?php 
    if (PORTFOLIO_INSTALL) {
        ?>

			<dt>Portfolio Area</dt>
			<dd>A Portfolio Area is similar to an area, but it contains &ldquo;Sections&rdquo; and &ldquo;Items&rdquo; instead of pages. The Portfolio Area will also appear in the list of Areas and Pages, allowing you to organize it into the structure of the rest of your site however you like. The Portfolio Area may simply be called &ldquo;Portfolio&rdquo;, and you may only need one. A Portfolio Area can have a description if your templates need it.</dd>
			
			<dt>Portfolio Section</dt>
			<dd>A Portfolio Section acts just like an Area. You may not need a bunch of these to organize your portfolio, but you need at least one. Unlike an Area, though, a Section can have a description like a page might have.</dd>
			
			<dt>Portfolio Item</dt>
			<dd>An Item is more like a page, with a title and description, and a thumbnail and a Gallery of images attached to it. In this way, an Item is like a Page and a Gallery combined into one object.</dd>
		<?php 
    }
    ?>
		<?php 
    if (GALLERY_INSTALL) {
        ?>

			<dt>Galleries</dt>
			<dd>Galleries are simply a collection of images, and the order of images in a gallery can be changed at any time. Images in galleries, however, can not be easily pulled from one and added to another. The source image would need to be uploaded again, so, it is a good idea to keep a version of these images on your computer for later use. </dd>
		<?php 
    }
    ?>
		<?php 
    if (VIDEO_INSTALL) {
        ?>
		    
		    <dt>Videos</dt>
			<dd>Videos are managed through the CMS as well. The embed codes are managed in one place, so if they need to change, they can be changed from one location and that change will go out to where ever the video is used. Right now, the HCd&gt;CMS supports embed codes for Vimeo and YouTube. Others can be embedded with the full share/embed code from the host service. </dd>
		<?php 
    }
    ?>
		</dl>
	</div>
	
	<div id="custom" class="dropslide" style="display:none;">
		<h2>Custom Content</h2>
		<p>Since the HCd&gt;CMS is so customizable, your site may have features not explained here.</p>
	</div>
	
	<p>&nbsp;</p>
	<!-- Now start the dashboard -->
	
<?php 
    $count_dashes = 0;
    if (BLOG_INSTALL) {
        ?>
	<div class="dashboard-widget column">
		<h1><?php 
        echo ucwords(BLOG_STATIC_AREA);
        ?>
 Entries</h1>
		<p>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/list_entries");
        ?>
">List Entries</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/edit_entry/add");
        ?>
">Add Entry</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/list_categories");
        ?>
">List Categories</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/add_category");
        ?>
">Add Category</a>
		</p>
		<h4>Recently Added Entries:</h4>
		<ul>
		<?php 
        $entries = MyActiveRecord::FindBySQL('Blog_Entries', "SELECT * FROM blog_entries ORDER BY date DESC LIMIT 5");
        if (!empty($entries)) {
            foreach ($entries as $entry) {
                $entrypublic = $entry->public ? "" : "<span class=\"red\">(not public)</span>";
                $entry_date = parseDate($entry->date, "m/d g:i A");
                echo "<li>\n\t\t\t\t\t\t\t<a class=\"item-link\" href=\"" . get_link("admin/edit_entry/" . $entry->id) . "\">" . $entry->get_title() . "</a>\n\t\t\t\t\t\t\t<span class=\"item-revised\">{$entry_date}</span>\n\t\t\t\t\t\t\t<span class=\"item-public\">{$entrypublic}</span>\n\t\t\t\t\t\t</li>";
            }
        }
        ?>
		</ul>
	</div>
<?php 
        $count_dashes++;
    }
    if (PORTFOLIO_INSTALL) {
        ?>
	<div class="dashboard-widget column">
		<h1>Portfolio</h1>
		<p>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_list");
        ?>
">List Items</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_add_item");
        ?>
">Add Item</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_add_section");
        ?>
">Add Section</a>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/portfolio_add_area");
        ?>
">Add Area</a>
		</p>
		<h4>Recently Added/Edited Items:</h4>
		<ul>
		<?php 
        $items = Items::FindThisMany(7);
        // BROKEN when the database is missing fields (prolly date_created, date_revised)
        if (!empty($items)) {
            foreach ($items as $theitem) {
                $itempublic = $theitem->public ? "" : "<span class=\"red\">(not public)</span>";
                $section = $theitem->theSection();
                $sectionname = empty($section->name) ? "orphan_section" : $section->name;
                $item_revised = empty($theitem->date_revised) ? '' : formatDateTimeView($theitem->date_revised, "m/d g:i A");
                echo "<li>\n\t\t\t\t\t\t\t<a class=\"item-link\" href=\"" . get_link("admin/portfolio_edit/{$sectionname}/" . $theitem->id) . "\">" . $theitem->get_title() . "</a>\n\t\t\t\t\t\t\t<span class=\"item-public\">{$itempublic}</span>\n\t\t\t\t\t\t\t<span class=\"item-revised\">{$item_revised}</span>\n\t\t\t\t\t\t</li>";
            }
        }
        ?>
		</ul>
	</div>
<?php 
        $count_dashes++;
    }
    if ($count_dashes == 2) {
        echo "<div class=\"clearleft\"></div>\n";
    }
    ?>
			
	<div class="dashboard-widget column">
		<h1>Pages</h1>
		<p>
			<a class="hcdbutton" href="<?php 
    echo get_link("admin/list_pages");
    ?>
">List Pages</a>
			<a class="hcdbutton" href="<?php 
    echo get_link("admin/add_page");
    ?>
">Add Page</a>
			<a class="hcdbutton" href="<?php 
    echo get_link("admin/edit_page/add");
    ?>
">Add Area</a>
			<?php 
    $chunks = Chunks::FindAll();
    if (count($chunks) > 0) {
        ?>
			<a class="hcdbutton" href="<?php 
        echo get_link("admin/list_pages#chunks-list");
        ?>
">List Chunks</a>
			<?php 
    }
    ?>
		</p>
		<h4>Recently Added Pages:</h4>
		<ul>
		<?php 
    $pages = Pages::FindAll("id DESC");
    if (!empty($pages)) {
        $counter = 0;
        foreach ($pages as $thepage) {
            if ($counter < 5) {
                $pagepublic = $thepage->public ? "" : "<span class=\"red\">(not public)</span>";
                //$item_revised = ( empty($theitem->date_revised) ) ? '' : formatDateTimeView( $theitem->date_revised, "m/d g:i A" );
                echo "<li>\n\t\t\t\t\t\t\t\t<a class=\"item-link\" href=\"" . get_link("admin/edit_page/" . $thepage->id) . "\">" . $thepage->get_title() . "</a>\n\t\t\t\t\t\t\t\t<span class=\"item-public\">{$pagepublic}</span>\n\t\t\t\t\t\t\t</li>";
                $counter++;
            }
        }
    }
    ?>
		</ul>
		<h4>Quick select</h4>
		<?php 
    quick_link();
    ?>
	</div>				
<?php 
    $count_dashes++;
    $classes = "dashboard-widget column";
    if (!is_odd($count_dashes)) {
        $classes = "quick_buttons";
        echo "<div class=\"clearleft\"></div>\n";
    }
    ?>
			
	<div class="<?php 
    echo $classes;
    ?>
">
		<h1>Manage Extras:</h1>
		<p>
			<?php 
    if (CALENDAR_INSTALL) {
        ?>
			<strong>Event Calendar:</strong> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/list_events");
        ?>
">Edit Events</a> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/add_event");
        ?>
">Add an Event</a><br /><br />
			
			<?php 
    }
    if (GALLERY_INSTALL) {
        ?>
			<strong>Image Galleries:</strong> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/list_galleries");
        ?>
">Edit Galleries</a> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/add_gallery");
        ?>
">Add Gallery</a><br /><br />
			
			<?php 
    }
    if (PRODUCT_INSTALL) {
        ?>
			<strong>Products:</strong> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/list_products");
        ?>
">Edit Products</a> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/add_product");
        ?>
">Add a Product</a><br /><br />
			
			<?php 
    }
    if (VIDEO_INSTALL) {
        ?>
            <strong>Video:</strong> 
            <a class="hcd_button" href="<?php 
        echo get_link("admin/list_videos");
        ?>
">Edit Videos</a> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/edit_video/add");
        ?>
">Add a Video</a><br /><br />
			
    		<?php 
    }
    if (TESTIMONIAL_INSTALL) {
        ?>
    		<strong>Testimonials:</strong> 
            <a class="hcd_button" href="<?php 
        echo get_link("admin/list_testimonials");
        ?>
">Edit Testimonials</a> 
			<a class="hcd_button" href="<?php 
        echo get_link("admin/edit_testimonial/add");
        ?>
">Add a Testimonial</a><br /><br />
    		
    		<?php 
    }
    ?>
    		<strong>Images:</strong> 
			<a class="hcd_button" href="<?php 
    echo get_link("admin/list_images");
    ?>
">Edit Images</a> 
			<a class="hcd_button" href="<?php 
    echo get_link("admin/add_image");
    ?>
">Upload an Image</a><br /><br />
			
			<strong>Documents:</strong> 
			<a class="hcd_button" href="<?php 
    echo get_link("admin/list_documents");
    ?>
">Edit Documents</a> 
			<a class="hcd_button" href="<?php 
    echo get_link("admin/add_document");
    ?>
">Upload a Document</a>
		</p>
	</div>
	
	<div class="clearleft"></div>
					
	<!-- TO DO
		Break out the insert patterns into its own tab for images, documents and galleries. Explain galleries better.
	-->
	
	<?php 
    include_once snippetPath("admin_tutorial_list");
}
Exemple #17
0
            <!-- Allow Screen readers (hidden for all others) to skip the navigation and get to the main content -->
            <div class="skip-link screen-reader-text">
                <a href="#content" title="Skip to content">Skip to content</a>
            </div>
            
            <div class="logo-container">
                <h1 class="site-title">
                    <a href="<?php 
echo BASEHREF;
?>
" title="Click to return to home page">
                        <?php 
echo SITE_NAME;
?>
                    </a>
                </h1>
            </div>
            
            <nav class="main-navigation" role="navigation">
                
                <a class="toggle-menu" href="#secondarymenu"><span class="menu-icon">&equiv;</span> Navigate</a>
                
<?php 
include snippetPath("main_menu_horizontal");
?>
            
            </nav>
        
        </div>
    </header>
Exemple #18
0
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title><?php 
echo SITE_NAME . " " . date("F j\\, Y");
?>
</title>
		<base href="http://<?php 
echo SITE_URL . BASEHREF;
?>
"></base>

<?php 
require_once snippetPath("mailblast-css");
?>

	</head>
	
	<body id="<?php 
echo $slug;
?>
_email_body" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
		
		<div id="<?php 
echo $slug;
?>
_email_template">
			<table cellpadding="0" cellspacing="0" border="0">
				<thead>
Exemple #19
0
function display_page_content()
{
    // Define a function to draw a post... easiest way to manage the output in one place
    function get_entry($thisentry, $link = true, $excerpt = false, $current_user = '')
    {
        $categories = $thisentry->get_categories() != '' ? ' in ' . $thisentry->get_categories() : '';
        $entry = '<article class="entry typography"><header>';
        // If there is an image
        if ($thisentry->template == 'with-image') {
            echo '<p>image</p>';
        }
        if ($link) {
            $entry .= '<h1 class="entry--title"><a href="' . $thisentry->get_url() . '">' . $thisentry->get_title() . '</a></h1>';
        } else {
            $entry .= '<h1 class="entry--title">' . $thisentry->get_title() . '</h1>';
        }
        // If an admin is logged in, set these flags so they can see new posts in the stream.
        if (empty($current_user)) {
            $public = $future = '';
        } else {
            $public = $thisentry->public ? '' : '<span class="entry--notpublic">Not Public</span> ';
            $future = $thisentry->date > date('Y-m-d h:i:s') ? '<span class="entry--future">Future Dated</span> ' : '';
        }
        $entry .= '<p class="entry--date-posted">' . $future . $public . ' <time datetime="' . $thisentry->get_pubdate("c") . '">' . $thisentry->get_pubdate('F j, Y') . '</time>' . $categories . '</p>';
        $entry .= '</header>';
        $entry .= '<div class="entry--content">';
        if ($excerpt) {
            // This preserves HTML and HCD images, but chops on a paragraph and adds a read more.
            $entry .= $thisentry->chopForBlogDigest(480, 'Read the Entire Post');
        } else {
            $entry .= $thisentry->get_content();
        }
        $entry .= '</div></article>' . "\n";
        return $entry;
    }
    function the_entry($thisentry, $link = true, $excerpt = false, $current_user = '')
    {
        echo get_entry($thisentry, $link, $excerpt, $current_user);
    }
    // Start the template
    /* This include sets the following: 
     * $page, $area or $area->is_portfolioarea(), is_object( $current_user )
     * $page_title, $description, $bodyclass, $template
     * getRequestVarAtIndex()s = $var0, $var1, $var2, $var3
     * isset( $blogarea ), isset( $category ), isset( $blogitem )
     */
    $area = Areas::FindById(3);
    include_once snippetPath("header");
    // Still need this to build the navigation and for previous and next posts
    $the_blog = Blogs::FindById(1);
    $entries_per_page = 8;
    $breadcrumbs = '<div class="breadcrumbs"><a class="breadcrumbs--link" href="' . BASEHREF . '">Home</a> <span class="breadcrumbs--sep">&raquo;</span> <a class="breadcrumbs--link" href="' . get_link(BLOG_STATIC_AREA) . '">' . $area->get_title() . '</a>';
    if (!empty($blogitem)) {
        $title = $blogitem->get_title();
        $breadcrumbs .= ' <span class="breadcrumbs--sep">&raquo;</span> <span class="breadcrumbs--link__active">' . chopText($title, 36, ' ') . '&hellip;</span>';
    }
    $breadcrumbs .= '</div>';
    ?>
                        
                        <?php 
    echo $breadcrumbs;
    ?>
                        
                        <div class="default-col">
                        
                            <section class="column" role="main">  
                                <div class="content--main">
<?php 
    // Single post
    if (!empty($blogitem)) {
        $singleentry = get_entry($blogitem, false, false, $current_user);
        $singleentry .= '<footer class="prevnext prevnext__entry" role="navigation"><ul class="prevnext--list menu">';
        // Previous entry link
        $prev = $the_blog->getPrevEntry($blogitem->date);
        $singleentry .= '<li class="prevnext--previous">';
        if (!empty($prev)) {
            $singleentry .= '<a class="prevnext--link prevnext--link__prev" href="' . $prev->get_URL() . '"><h4 class="prevnext--label">Previous:</h4><h2 class="prevnext--title">' . $prev->get_title() . '</h2></a>';
        } else {
            $singleentry .= '&nbsp;';
        }
        $singleentry .= '</li>';
        // Next entry link
        $next = $the_blog->getNextEntry($blogitem->date);
        $singleentry .= '<li class="prevnext--next">';
        if (!empty($next)) {
            $singleentry .= '<a class="prevnext--link prevnext--link__next" href="' . $next->get_URL() . '"><h4 class="prevnext--label">Next</h4><h2 class="prevnext--title">' . $next->get_title() . '</h2></a></li>';
        } else {
            $singleentry .= '&nbsp;';
        }
        $singleentry .= '</li></ul></footer>';
        echo $singleentry;
    } else {
        // Landing page or Filtered page
        echo '<div class="entry--wrapper">';
        $public = is_object($current_user) ? false : true;
        // Check for category
        if (isset($category)) {
            $pagenum = '';
            $entries = $category->getEntries();
            echo '<header class="category--header">';
            $category->the_title('<h1 class="category--title">Posts in <b>&ldquo;', '&rdquo;</b></h1>');
            echo '</header>' . "\n";
            // Check for Year archive
        } elseif ($var1 == 'year' and is_numeric($var2)) {
            $pagenum = '';
            $entries = Blog_Entries::FindByYear($var2, $public);
            echo '<header class="category--header">';
            echo '<h1 class="category--title">Posts from <b>' . $var2 . '</b></h1>';
            echo '</header>' . "\n";
            // Not a category landing page, not a year archive, and not a single item, so, this is the blog landing page
        } else {
            $pagenum = $var1 == "page" ? $var2 : 1;
            $entries = Blog_Entries::FindByPagination($entries_per_page, $pagenum, $public);
        }
        // The list of articles if there is not a single article present
        foreach ($entries as $entry) {
            the_entry($entry, true, true, $current_user);
        }
        // Add some pagination
        if (!empty($pagenum)) {
            ?>

                                    <footer class="pagination">
                                        <ul class="pagination--list menu">
                                        <?php 
            $lastpage = Blog_Entries::FindLastPage($entries_per_page, $public);
            $numbernav = "";
            if ($pagenum > 1) {
                $numbernav .= '<li class="pagination--listitem"><a class="pagination--link pagination--link__prev" href="' . get_link(BLOG_STATIC_AREA . "/page/" . ($pagenum - 1)) . '" title="View Newer Posts">&#9664;</a></li>';
            }
            $counter = 1;
            while ($counter <= $lastpage) {
                $thispage = $counter == $pagenum ? ' pagination--link__disabled' : '';
                $numbernav .= '<li class="pagination--listitem"><a class="pagination--link' . $thispage . '" href="' . get_link(BLOG_STATIC_AREA . "/page/" . $counter) . '">' . $counter . '</a></li>';
                $counter++;
            }
            if ($pagenum != $lastpage) {
                $numbernav .= '<li class="pagination--listitem"><a class="pagination--link pagination--link__next" href="' . get_link(BLOG_STATIC_AREA . "/page/" . ($pagenum + 1)) . '" title="View Older Posts">&#9654;</a></li>';
            }
            echo $numbernav;
            ?>
                                        
                                        </ul>
                                    </footer> 
<?php 
        }
        echo '</div><!-- end .entry--wrapper -->';
    }
    // end if
    ?>
 

                                </div>
                            </section>
                            
                            <aside class="content--sidebar column" role="complementary">
                            <?php 
    // List All the Categories
    // Show/Hide empty ones, show/hide the number of posts, show/hide the 'Uncategorized' category.
    $posts_by_category = $the_blog->list_categories(true, false, true);
    if (!empty($posts_by_category)) {
        echo '<div class="widget widget__categories"><h2 class="widget--title">Categories</h2>' . $posts_by_category . '</div>';
    }
    // List the unique years
    $archive = '<div class="widget widget__archive"><h2 class="widget--title">Archive</h2><ul class="widget--list menu">';
    $allyears = Blog_Entries::FindUniqueYears();
    foreach ($allyears as $year) {
        $archive .= '<li><a href="' . get_link(BLOG_STATIC_AREA . '/year/' . $year->year) . '">' . $year->year . '</a></li>';
    }
    $archive .= '</ul></div>';
    echo $archive;
    ?>
                                
                            </aside>
                        </div><!-- end .default-col -->


<?php 
    include_once snippetPath("footer");
    echo Blogs::DisplayBlogEditLinks(1, $blogitem);
}
Exemple #20
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 
}
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)
}
Exemple #22
0
                		<h3 class="image--title">We <strong>build</strong> it.</h3>
                	</div>
                </div>
                <div class="column image love">
                    <div class="image--crop image--horizontal">
                		<img src="<?php 
echo BASEHREF;
?>
img/home-right-horiz.jpg" alt="for custom home projects" />
            		</div>
                	<div class="love--content">
                		<h3 class="image--title">You <strong>love</strong> it.</h3>
                	</div>
                </div>
            </div>
    
            <div class="three-col--message">
                <aside class="column logo">
                    <img src="<?php 
echo BASEHREF;
?>
img/plants-stone-water.png" alt="Plants Stone Water" />
                </aside>
                <article class="column message home--message">
            		<p><span class="brand">Magma</span> is the fundamental building block of the earth. Its movement is fluid, deliberate, and often energetic. What it leaves in its wake are creations that inspire awe. </p> 
                </article>
            </div>

<?php 
include_once snippetPath("footer");
Exemple #23
0
function display_page_content()
{
    $category_id = requestIdParam();
    $category = Categories::FindById($category_id);
    ?>

	<script type="text/javascript">
		//<![CDATA[
	    loadTinyMce("category_content");
		
		$().ready(function() {
			
			$("#category").validate({
				rules: {
						display_name: "required",
					},
				messages: {
						display_name: "Please enter a display name for this category",
					}
			});
		});
		//]]>
	</script>
	
	<div id="edit-header" class="categorynav">
		<h1>Add a Category</h1>
	</div>
	
	<form method="POST" id="add_blog">
		<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 display name of the category; how it will display in navigation.</span><br />
			<?php 
    textField("display_name", $category->display_name, "required: true");
    ?>
		</p>
		
		<p>
			<label for="category_content">Content (optional &ndash; not all templates may display this content):</label><br />
			<?php 
    textArea("category_content", $category->content, 98, EDIT_WINDOW_HEIGHT);
    ?>
		</p>
		
<?php 
    require_once snippetPath("admin-insert_configs");
    ?>
					
		
		<div id="edit-footer" class="categorynav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Edit Category" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Edit and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
			<?php 
    if ($category->id == 1) {
        ?>
			
				<p class="red">Sorry, the default category can not be deleted.</p>
			<?php 
    } else {
        ?>
				
				<p>
					<label for="delete">Delete this category?</label>
					<input name="delete" class="boxes" type="checkbox" value='<?php 
        echo $category->id;
        ?>
' />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this category from the database</span>
				</p>
			<?php 
    }
    ?>
			
			</div>
		</div>
		
	</form>
<?php 
}