Exemplo n.º 1
0
function display_page_content()
{
    if (requestIdParam() == "add") {
        $chunk = $chunkslug = $chunkdescription = $chunkcontent = null;
        $chunkhtml = 0;
    } else {
        $chunk_id = requestIdParam();
        $chunk = Chunks::FindById($chunk_id);
        $chunkslug = $chunk->slug;
        $chunkdescription = $chunk->description;
        $chunkhtml = $chunk->full_html;
        $chunkcontent = $chunk->content;
    }
    $user = Users::GetCurrentUser();
    ?>

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

<?php 
    } else {
        ?>

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

<?php 
    }
    ?>

    		<div class="clearit"></div>
		</div>
		<div class="column half last">
    		
    		<p>
    			<label for="chunk_content">Content:</label>
    			<?php 
    textArea("chunk_content", $chunkcontent, 98, 18);
    ?>
    		</p>
    		
		</div>
		<div class="clearleft"></div>
		
		
		<div id="edit-footer" class="chunknav clearfix">
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Chunk" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
<?php 
    if ($user->email == '*****@*****.**') {
        ?>
	
				<p><label for="delete">Delete this chunk?</label>
					<input name="delete" class="boxes" type="checkbox" value="<?php 
        echo $chunk->id;
        ?>
" />
					<span class="hint">Check the box and then click &ldquo;Save&rdquo; above to delete this chunk from the database</span>
				</p>
<?php 
    }
    ?>
			</div>
		</div>
	
	</form>
<?php 
}
Exemplo n.º 2
0
function get_recurrence_tag($recurrences = array(), $day, $modifier)
{
    $checked = edit_eventRecurrenceExists($recurrences, $day, $modifier);
    checkBoxField("recurrence_{$day}[]", $checked, $modifier);
}
Exemplo n.º 3
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 
}
Exemplo n.º 4
0
function display_page_content()
{
    $add_area = requestIdParam() == "add" ? true : false;
    if ($add_area) {
        $area = $is_global = $area_id = $areadisplayname = $areaseotitle = $areaname = $areapublic = $areatemplate = null;
    } else {
        $area_id = requestIdParam();
        $area = Areas::FindById($area_id);
        $is_global = $area->id == 1 ? true : false;
        $areaid = $area->id;
        $areadisplayname = $area->display_name;
        $areaseotitle = $area->seo_title;
        $areaname = $area->name;
        $areapublic = $area->public;
        $areatemplate = $area->template;
    }
    ?>

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

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

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

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

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

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

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

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

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

<?php 
}
Exemplo n.º 7
0
function get_recurrence_tag($recurrences = array(), $day, $modifier)
{
    checkBoxField("recurrence_{$day}[]", 0, $modifier);
}
Exemplo n.º 8
0
function display_page_content()
{
    $list = NLLists::FindById(requestIdParam());
    $emails = $list->findEmails();
    $subscribers = count($emails);
    ?>

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

    				</tr>
    			</tbody>
    		</table>
        </div>
        
	</form>
<?php 
}
Exemplo n.º 9
0
function display_page_content()
{
    $portareas = Areas::FindPortAreas(false);
    $sections = Sections::FindAll();
    ?>

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

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

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

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

	</form>
<?php 
    }
    // end count($sections)
}
Exemplo n.º 10
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 
}
Exemplo n.º 11
0
function display_page_content()
{
    ?>

						<script type="text/javascript">
							$().ready(function() {
								$("#add_venue").validate({
										rules : {
											name: "required",
											description: "required"
										},
										messages: {
											name: "Please a name for this list",
											description: "Please enter a description for this list"
										}
									});
							});
						</script>
						
						<form method="POST" enctype="multipart/form-data" id="add_venue">
							<h1>Add a New List</h1>
							
							<p><label for="name">Name:</label><br />
								<?php 
    textField("name", "", "required: true");
    ?>
							
							</p>				
							
							<p>
								<label for="template">Template:</label>
								<select id="template" name="template">
									<?php 
    $templates = list_mail_templates();
    foreach ($templates as $template) {
        $text = $template;
        $selected_string = "";
        if ($text == "default") {
            $selected_string = " selected";
        }
        echo "<option value=\"{$template}\"{$selected_string}>{$text}</option>";
    }
    ?>
									
								</select>
							</p>
							
							<p><label for="public">Public List:</label>
							<?php 
    checkBoxField("public", 0, "1");
    ?>
							
							</p>
														
							<p><label for="description">Description of List:</label><br />
								<?php 
    textArea("description", "", 98, 10);
    ?>
							
							</p>
							
							<p><label for="emails">Emails:</label>
								<span class="hint">This field requires a comma delimited list of emails ie blah@blah.org, blag@blag.net, etc.</span></p>
								<textarea class="mceNoEditor" name="emails" id="emails" rows="8" style="width: 98%;"></textarea>
							
							</p>
														
							<input type="submit" class="submitbutton" name="submit" value="Add New List" />
						</form>
<?php 
}
Exemplo n.º 12
0
function display_page_content()
{
    $portareas = Areas::FindPortAreas(false);
    $item_id = getRequestVaratIndex(3);
    $item = Items::FindById($item_id);
    $next_item = $prev_item = "";
    $sectionname = getRequestVaratIndex(2);
    if ($sectionname != "orphan_section") {
        // Problem is, there could be two sections with the same name in different Areas. So, loop through the Sections attached to this item
        $item_sections = $item->getSections();
        foreach ($item_sections as $thissect) {
            if ($thissect->name == $sectionname) {
                $a_section = Sections::FindById($thissect->id);
                $thisarea = $a_section->thePortfolioArea();
                $next_item = $item->findNext($a_section, "");
                $prev_item = $item->findPrev($a_section, "");
                break;
            }
        }
    }
    $user = Users::GetCurrentUser();
    // If a gallery gets detached or this item doesn't have one, don't create an error.
    $gallery = $item->getGallery();
    if (is_object($gallery)) {
        $photos = $gallery->get_photos();
        $photocount = count($photos) == 0 ? "None" : count($photos);
        // Sometimes the following statement throws errors. Check it out if this page behaves funny.
        if (ITEM_VIDEOS) {
            $gallery_items = $gallery->get_photos_and_videos();
            $photocount = count($gallery_items) == 0 ? "None" : count($gallery_items);
            $itemvideos = $item->findVideos($gallery, 'display_order DESC');
            $vidcount = count($itemvideos) == 0 ? "None" : count($itemvideos);
        }
    } else {
        $gallery = false;
        $photos = $itemvideos = $gallery_items = null;
        $photocount = 0;
        $vidcount = "None";
    }
    if (ITEM_DOCUMENTS) {
        $itemdocuments = $item->findDocuments('display_order DESC');
        $doccount = count($itemdocuments) == 0 ? "None" : count($itemdocuments);
    }
    ?>

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

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


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


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

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

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

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

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

		<div id="edit-footer" class="itemnav clearfix">
			<div id="error_container"></div>
			<div class="column half">
		
				<p>
					<input type="submit" class="submitbutton" name="submit" value="Save Item" /> <br />
					<input type="submit" class="submitbuttonsmall" name="submit" value="Save and Return to List" />
				</p>
				
			</div>
			<div class="column half last">
				
			<?php 
    if ($user->has_role()) {
        ?>
				
				<p><label for="delete">Delete this item? <input name="delete" id="delete" class="boxes" type="checkbox" value="<?php 
        echo $item->id;
        ?>
" /></label>
				<span class="hint">Check this box and then click &ldquo;Save&rdquo; to delete from the database</span></p>
			<?php 
    }
    ?>
			
			</div>
		</div>
		
	</form>
<?php 
}
Exemplo n.º 13
0
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 
}
Exemplo n.º 14
0
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 
}