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;?>"><img src="<?php echo $_base_href; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']?>/images/previous.png" alt="<?php echo _AT('previous'); ?>" title="<?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;?>"><img src="<?php echo $_base_href; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']?>/images/next.png" alt="<?php echo _AT('next'); ?>" title="<?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 AT_print($this->photo_info['description'], 'input.text'); ?>" alt="<?php echo AT_print($this->photo_info['alt_text'], 'input.text') ;?>" />
21 <?php if ($this->action_permission): ?>
22 <div class="flc-inlineEditable"><span class="flc-inlineEdit-text"><?php echo AT_print($this->photo_info['description'], 'photos.description');?></span></div>
24 <div><span><?php echo htmlentities_utf8($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">
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 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 AT_print($comment_array['comment'], 'photos.comment');?></span>
42 <a href="profile.php?id=<?php echo $comment_array['member_id'];?>"><strong><?php echo AT_print(get_display_name($comment_array['member_id']), 'members.full_name'); ?></a></strong>
43 <?php echo htmlentities_utf8($comment_array['comment'], true);?>
48 <div class="comment_actions">
49 <?php echo AT_date(_AT('forum_date_format'), $comment_array['created_date'], AT_DATE_MYSQL_DATETIME);?>
50 <?php if ($this->action_permission || $comment_array['member_id']==$_SESSION['member_id']): ?>
51 <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>
56 <?php endforeach; endif; ?>
57 <!-- TODO: Add script to check, comment cannot be empty. -->
58 <form action="<?php echo AT_PA_BASENAME;?>addComment.php" method="post" class="input-form">
59 <div class="row"><label for="comments"><?php echo _AT('comments');?></label></div>
60 <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>
61 <div class="row"><textarea name="comment" id="comment" style="display:none;"></textarea></div>
63 <input type="hidden" name="pid" value="<?php echo $this->photo_info['id'];?>" />
64 <input type="hidden" name="aid" value="<?php echo $this->aid;?>" />
65 <input type="submit" name="submit" value="<?php echo _AT('comment');?>" class="button"/>
70 <?php if($this->action_permission): ?>
71 <div class="photo_actions">
72 <a href="<?php echo AT_PA_BASENAME.'edit_photos.php?aid='.$this->aid.SEP.'pid='.$this->photo_info['id']; ?>" class="pa_tool_link"><img src="<?php echo $_base_href; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/edit.gif" alt="" border="0" class="pa_tool_image"/><?php echo _AT('pa_edit_photo'); ?></a><br/>
73 <a href="<?php echo AT_PA_BASENAME.'delete_photo.php?pid='.$this->photo_info['id'].SEP.'aid='.$this->aid;?>" class="pa_tool_link"><img src="<?php echo $_base_href; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/x.gif" alt="" border="0" class="pa_tool_image"/><?php echo _AT('pa_delete_this_photo'); ?></a><br/>
74 <a href="<?php echo AT_PA_BASENAME.'set_profile_picture.php?pid='.$this->photo_info['id'].SEP.'aid='.$this->aid;?>" class="pa_tool_link"><img src="<?php echo $_base_href; ?>themes/<?php echo $_SESSION['prefs']['PREF_THEME']; ?>/images/profile.gif" alt="" border="0" class="pa_tool_image"/><?php echo _AT('pa_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 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_photos.php';?>",
116 "pid":<?php echo $this->photo_info['id'];?>,
117 "aid":<?php echo $this->aid;?>,
118 "description_<?php echo $this->photo_info['id'];?>":model.value,
119 "alt_text_<?php echo $this->photo_info['id'];?>":"<?php echo trim($this->photo_info['alt_text']);?>"},
124 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
125 if (newValue != oldValue){
126 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_photos.php';?>",
128 "pid":<?php echo $this->photo_info['id'];?>,
129 "aid":<?php echo $this->aid;?>,
130 "description_<?php echo $this->photo_info['id'];?>":newValue,
131 "alt_text_<?php echo $this->photo_info['id'];?>":"<?php echo trim($this->photo_info['alt_text']);?>"},
139 /* inline edit for photo album comments */
140 fluid.inlineEdits(".comment_feeds", {
141 componentDecorators: {
142 type: "fluid.undoDecorator",
147 defaultViewText: pa_click_here_to_edit,
149 tooltipText: pa_click_item_to_edit,
151 modelChanged: function(model, oldModel, source){
152 /* for undo/redo model change */
153 if (model != oldModel && source != undefined){
154 commentID = source.component.locate("text").attr("id");
155 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_comment.php';?>",
157 "pid":<?php echo $this->photo_info['id'];?>,
158 "aid":<?php echo $this->aid;?>,
160 "comment":model.value},
165 afterFinishEdit : function (newValue, oldValue, editNode, viewNode) {
166 if (newValue != oldValue){
167 rtn = jQuery.post("<?php echo $_base_path. AT_PA_BASENAME.'edit_comment.php';?>",
169 "pid":<?php echo $this->photo_info['id'];?>,
170 "aid":<?php echo $this->aid;?>,