2 <!-- frame that holds the 604px picture -->
3 <div class="photo_panel" id="photo_panel">
4 <!-- Photo ordering and prev/next -->
5 <?php if($this->photo_info['ordering'] <= $this->total_photos): ?>
6 <div class="ordering"><?php echo _AT('pa_photo').' '.$this->photo_info['ordering'].' '._AT('pa_of').' '.$this->total_photos ; ?></div>
7 <div class="paginator">
9 <?php if (isset($this->prev)): ?>
10 <li><a href="<?php echo AT_PA_BASENAME.'photo.php?pid='.$this->prev['id'].SEP.'aid='.$this->aid;?>"><?php echo _AT('previous'); ?></a></li>
12 <?php if (isset($this->next)): ?>
13 <li><a href="<?php echo AT_PA_BASENAME.'photo.php?pid='.$this->next['id'].SEP.'aid='.$this->aid;?>"><?php echo _AT('next'); ?></a></li>
18 <div style="clear:both"></div>
20 <img src="<?php echo AT_PA_BASENAME.'get_photo.php?aid='.$this->aid.SEP.'pid='.$this->photo_info['id'].SEP.'size=o'.SEP.'ph='.getPhotoFilePath($this->photo_info['id'], '', $this->photo_info['created_date']);?>" title="<?php echo htmlentities_utf82($this->photo_info['description'], false); ?>" alt="<?php echo htmlentities_utf82($this->photo_info['alt_text']) ;?>" />
21 <?php if ($this->action_permission): ?>
22 <div class="flc-inlineEditable"><span class="flc-inlineEdit-text"><?php echo htmlentities_utf82($this->photo_info['description']);?></span></div>
24 <div><span><?php echo htmlentities_utf82($this->photo_info['description'], true);?></span></div>
29 <div class="comment_panel">
30 <div class="comment_feeds">
31 <?php if(!empty($this->comments)): ?>
32 <?php foreach($this->comments as $k=>$comment_array): ?>
33 <div class="comment_box" id="comment_box">
34 <!-- TODO: Profile link and img -->
35 <?php if ($this->action_permission || $comment_array['member_id']==$_SESSION['member_id']): ?>
36 <div class="flc-inlineEditable">
37 <a href="profile.php?id=<?php echo $comment_array['member_id'];?>"><strong><?php echo htmlentities_utf82(AT_print(get_display_name($comment_array['member_id']), 'members.full_name')); ?></a></strong>
38 <span class="flc-inlineEdit-text" id="<?php echo $comment_array['id'];?>" ><?php echo htmlentities_utf82($comment_array['comment']);?></span>
42 <a href="profile.php?id=<?php echo $comment_array['member_id'];?>"><strong><?php echo htmlentities_utf82(AT_print(get_display_name($comment_array['member_id']), 'members.full_name')); ?></a></strong>
43 <?php echo htmlentities_utf82($comment_array['comment'], true);?>
47 <div class="comment_actions">
48 <?php echo AT_date(_AT('forum_date_format'), $comment_array['created_date'], AT_DATE_MYSQL_DATETIME);?>
49 <?php if ($this->action_permission || $comment_array['member_id']==$_SESSION['member_id']): ?>
50 <a href="<?php echo AT_PA_BASENAME.'delete_comment.php?aid='.$this->aid.SEP.'pid='.$this->photo_info['id'].SEP.'comment_id='.$comment_array['id']?>"><?php echo _AT('delete');?></a>
55 <?php endforeach; endif; ?>
56 <!-- TODO: Add script to check, comment cannot be empty. -->
57 <form action="<?php echo AT_PA_BASENAME;?>addComment.php" method="post" class="input-form">
58 <div class="row"><label for="comments"><?php echo _AT('comments');?></label></div>
59 <div class="row"><textarea name="comment" id="comment_template" onclick="jQuery(this).hide();c=jQuery('#comment');c.show();c.focus();" onkeyup="jQuery(this).hide();c=jQuery('#comment');c.show();c.focus();"><?php echo _AT('pa_write_a_comment'); ?></textarea></div>
60 <div class="row"><textarea name="comment" id="comment" style="display:none;"></textarea></div>
62 <input type="hidden" name="pid" value="<?php echo $this->photo_info['id'];?>" />
63 <input type="hidden" name="aid" value="<?php echo $this->aid;?>" />
64 <input type="submit" name="submit" value="<?php echo _AT('comment');?>" class="button"/>
69 <?php if($this->action_permission): ?>
70 <div class="photo_actions">
71 <a href="<?php echo AT_PA_BASENAME.'edit_photos.php?aid='.$this->aid.SEP.'pid='.$this->photo_info['id']; ?>"><?php echo _AT('pa_edit_photo'); ?></a><br/>
72 <a href="<?php echo AT_PA_BASENAME.'delete_photo.php?pid='.$this->photo_info['id'].SEP.'aid='.$this->aid;?>"><?php echo _AT('pa_delete_this_photo'); ?></a><br/>
73 <!-- TODO: is this needed? -->
74 <!-- <a href=""><?php echo _AT('set_profile_pic'); ?></a> -->
77 <div class="photo_actions">
78 <p><?php echo _AT('pa_uploaded_by').': '.AT_print(get_display_name($this->photo_info['member_id']), 'members.full_name'); ?></p>
84 <script type="text/javascript">
85 jQuery(document).ready(function () {
86 //the ATutor undo function
87 var undo = function (that, targetContainer) {
88 var markup = "<span class='flc-undo' aria-live='polite' aria-relevant='all'>" +
89 "<span class='flc-undo-undoContainer'>[<a href='#' class='flc-undo-undoControl'><?php echo _AT('pa_undo'); ?></a>]</span>" +
90 "<span class='flc-undo-redoContainer'>[<a href='#' class='flc-undo-redoControl'><?php echo _AT('pa_redo'); ?></a>]</span>" +
92 var markupNode = jQuery(markup);
93 targetContainer.append(markupNode);
96 var pa_click_here_to_edit = '<?php echo _AT("pa_click_here_to_edit"); ?>';
97 var pa_click_item_to_edit = '<?php echo _AT("pa_click_item_to_edit"); ?>';
99 /* inline edit for photo panel description */
100 fluid.inlineEdits("#photo_panel", {
101 componentDecorators: {
102 type: "fluid.undoDecorator",
107 defaultViewText: pa_click_here_to_edit,
109 tooltipText: pa_click_item_to_edit,
111 modelChanged: function(model, oldModel, source){
112 /* for undo/redo model change */
113 if (model != oldModel && source != undefined){
114 viewNode = source.component.container.children('.flc-inlineEdit-text')[0];
115 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_photos.php';?>",
117 "pid":<?php echo $this->photo_info['id'];?>,
118 "aid":<?php echo $this->aid;?>,
119 "description_<?php echo $this->photo_info['id'];?>":model.value,
120 "alt_text_<?php echo $this->photo_info['id'];?>":"<?php echo trim($this->photo_info['alt_text']);?>"},
125 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
126 if (newValue != oldValue){
127 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_photos.php';?>",
129 "pid":<?php echo $this->photo_info['id'];?>,
130 "aid":<?php echo $this->aid;?>,
131 "description_<?php echo $this->photo_info['id'];?>":newValue,
132 "alt_text_<?php echo $this->photo_info['id'];?>":"<?php echo trim($this->photo_info['alt_text']);?>"},
140 /* inline edit for photo album comments */
141 fluid.inlineEdits(".comment_feeds", {
142 componentDecorators: {
143 type: "fluid.undoDecorator",
148 defaultViewText: pa_click_here_to_edit,
150 tooltipText: pa_click_item_to_edit,
152 modelChanged: function(model, oldModel, source){
153 /* for undo/redo model change */
154 if (model != oldModel && source != undefined){
155 viewNode = source.component.container.children('.flc-inlineEdit-text')[0];
156 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_comment.php';?>",
158 "pid":<?php echo $this->photo_info['id'];?>,
159 "aid":<?php echo $this->aid;?>,
161 "comment":model.value},
166 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
167 if (newValue != oldValue){
168 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_comment.php';?>",
170 "pid":<?php echo $this->photo_info['id'];?>,
171 "aid":<?php echo $this->aid;?>,