Changeset 601
- Timestamp:
- 04/29/05 14:21:46 (7 years ago)
- Location:
- trunk/wifidog-auth
- Files:
-
- 11 modified
-
ChangeLog (modified) (1 diff)
-
wifidog/admin/generic_object_admin.php (modified) (2 diffs)
-
wifidog/admin/hotspot.php (modified) (1 diff)
-
wifidog/classes/Content.php (modified) (13 diffs)
-
wifidog/classes/Content/ContentGroup.php (modified) (4 diffs)
-
wifidog/classes/Content/EmbeddedContent.php (modified) (2 diffs)
-
wifidog/classes/Content/Langstring.php (modified) (2 diffs)
-
wifidog/classes/Content/PatternLanguage.php (modified) (2 diffs)
-
wifidog/classes/ContentGroupElement.php (modified) (4 diffs)
-
wifidog/classes/Network.php (modified) (3 diffs)
-
wifidog/classes/Node.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wifidog-auth/ChangeLog
r600 r601 1 2005-04-29 François Proulx <francois.proulx@gmail.com> 2 * Removed all inline unuseful javascript code on submit buttons onclick='submit()' 3 * This conflicted with the actual click on the submit button in Safari 4 * Fixed check in Network for isOwner, only check superAdmin 5 * Fixed bug so you can't add an existing content group to itself ( deadlock ) 6 * Started coding Pattern language narrative display 7 1 8 2005-04-29 François Proulx <francois.proulx@gmail.com> 2 9 * Wrote User.php addcontent, removeContent, getAllContent() -
trunk/wifidog-auth/wifidog/admin/generic_object_admin.php
r593 r601 113 113 $node = Node :: getObject($node_id); 114 114 Node :: setCurrentNode($node); 115 116 $html .= "<h1>"._("Showing preview as it would appear at ").$node->getName()."</h1><p>"; 115 117 } 116 118 $common_input = ''; … … 127 129 $name = "node_id"; 128 130 $html .= Node :: getSelectNodeUI($name); 129 131 130 132 $html .= $object->getUserUI(); 131 133 $html .= "<input type='hidden' name='action' value='preview'>\n"; -
trunk/wifidog-auth/wifidog/admin/hotspot.php
r573 r601 167 167 try { 168 168 $node = Node::getObject($node_id); 169 $node->delete( );169 $node->delete($errmsg); 170 170 } catch (Exception $e) { 171 171 echo '<p class="warning">'.$e->getMessage().'</p>'; -
trunk/wifidog-auth/wifidog/classes/Content.php
r600 r601 172 172 $value = _("Add"); 173 173 } 174 $html .= "<input type='submit' name='$name' value='$value'>"; // onclick='submit();'174 $html .= "<input type='submit' name='$name' value='$value'>"; 175 175 return $html; 176 176 } … … 378 378 public function isDisplayableAt($node) 379 379 { 380 381 380 return true; 382 381 } … … 598 597 $html .= "<div class='admin_section_tools'>\n"; 599 598 $name = "content_".$this->id."_title_erase"; 600 $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>";599 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 601 600 $html .= "</div>\n"; 602 601 } … … 629 628 $html .= "<div class='admin_section_tools'>\n"; 630 629 $name = "content_".$this->id."_description_erase"; 631 $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>";630 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 632 631 $html .= "</div>\n"; 633 632 } … … 650 649 $html .= "<div class='admin_section_tools'>\n"; 651 650 $name = "content_".$this->id."_project_info_erase"; 652 $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>";651 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 653 652 $html .= "</div>\n"; 654 653 } … … 671 670 $html .= "<div class='admin_section_tools'>\n"; 672 671 $name = "content_".$this->id."_sponsor_info_erase"; 673 $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>";672 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 674 673 $html .= "</div>\n"; 675 674 } … … 701 700 $html .= "<div class='admin_section_tools'>\n"; 702 701 $name = "content_".$this->id."_owner_".$user->GetId()."_remove"; 703 $html .= "<input type='submit' name='$name' value='"._("Remove")."' onclick='submit();'>";702 $html .= "<input type='submit' name='$name' value='"._("Remove")."'>"; 704 703 $html .= "</div>\n"; 705 704 $html .= "</li>\n"; … … 714 713 $name = "content_{$this->id}_add_owner_submit"; 715 714 $value = _("Add owner"); 716 $html .= "<input type='submit' name='$name' value='$value' onclick='submit();'>";715 $html .= "<input type='submit' name='$name' value='$value'>"; 717 716 $html .= "</div>\n"; 718 717 $html .= "</li>\n"; … … 757 756 { 758 757 $db->ExecSqlUpdate("UPDATE content SET title = NULL WHERE content_id = '$this->id'", FALSE); 759 $title->delete( );758 $title->delete($errmsg); 760 759 } 761 760 else … … 786 785 { 787 786 $db->ExecSqlUpdate("UPDATE content SET description = NULL WHERE content_id = '$this->id'", FALSE); 788 $description->delete( );787 $description->delete($errmsg); 789 788 } 790 789 else … … 811 810 { 812 811 $db->ExecSqlUpdate("UPDATE content SET project_info = NULL WHERE content_id = '$this->id'", FALSE); 813 $project_info->delete( );812 $project_info->delete($errmsg); 814 813 } 815 814 else … … 836 835 { 837 836 $db->ExecSqlUpdate("UPDATE content SET sponsor_info = NULL WHERE content_id = '$this->id'", FALSE); 838 $sponsor_info->delete( );837 $sponsor_info->delete($errmsg); 839 838 } 840 839 else … … 888 887 } 889 888 } 889 890 /** 891 * Tell if a given user is already subscribed to this content 892 * @param User the given user 893 * @return boolean 894 */ 895 public function isUserSubscribed(User $user) 896 { 897 global $db; 898 $sql = "SELECT content_id FROM user_has_content WHERE user_id = '{$user->getId()}' AND content_id = '{$this->getId()}';"; 899 $db->ExecSqlUniqueRes($sql, $row, false); 900 901 if($row) 902 return true; 903 else 904 return false; 905 } 906 890 907 /** Subscribe to the project 891 908 * @return true on success, false on failure */ -
trunk/wifidog-auth/wifidog/classes/Content/ContentGroup.php
r593 r601 390 390 $html .= "<div class='admin_section_tools'>\n"; 391 391 $name = "content_group_".$this->id."_element_".$element->GetId()."_erase"; 392 $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>";392 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 393 393 $html .= "</div>\n"; 394 394 $html .= "</li>\n"; … … 397 397 $html .= "<b>"._("Add a new content OR select previously created content")."</b><br>"; 398 398 $html .= self :: getNewContentUI("content_group_{$this->id}_new_element")."<br>"; 399 $html .= self :: getSelectContentUI("content_group_{$this->id}_existing_element" );399 $html .= self :: getSelectContentUI("content_group_{$this->id}_existing_element", "AND content_id != '$this->id'"); 400 400 $html .= "<input type='submit' name='content_group_{$this->id}_existing_element_add' value='"._("Add")."'>"; 401 401 $html .= "</li>\n"; … … 695 695 /** Retreives the user interface of this object. Anything that overrides this method should call the parent method with it's output at the END of processing. 696 696 * @param $subclass_admin_interface Html content of the interface element of a children 697 * @param boolean $hide_elements allows the child class ( for example 698 * Pattern Language) to tell the content group not to display elements ) for 699 * elements that need to be hidden before subscription 697 700 * @return The HTML fragment for this interface */ 698 public function getUserUI($subclass_user_interface = null )701 public function getUserUI($subclass_user_interface = null, $hide_elements = false) 699 702 { 700 703 $html = ''; … … 702 705 $html .= "<div class='user_ui_object_class'>ContentGroup (".get_class($this)." instance)</div>\n"; 703 706 704 $display_elements = $this->getDisplayElements(); 705 if (count($display_elements) > 0) 706 { 707 foreach ($display_elements as $display_element) 708 { 709 // If the content group logging is disabled, all the children will inherit this property temporarly 710 if($this->getLoggingStatus() == false) 711 $display_element->setLoggingStatus(false); 712 $html .= $display_element->getUserUI(); 713 } 714 } 715 else 716 { 717 $html .= '<p class="warningmsg">'._("Sorry, no elements available at this hotspot or all elements of the content group have already been shown")."</p>\n"; 718 } 707 if($hide_elements == false) 708 { 709 $display_elements = $this->getDisplayElements(); 710 if (count($display_elements) > 0) 711 { 712 foreach ($display_elements as $display_element) 713 { 714 // If the content group logging is disabled, all the children will inherit this property temporarly 715 if($this->getLoggingStatus() == false) 716 $display_element->setLoggingStatus(false); 717 $html .= $display_element->getUserUI(); 718 } 719 } 720 else 721 { 722 $html .= '<p class="warningmsg">'._("Sorry, no elements available at this hotspot or all elements of the content group have already been shown")."</p>\n"; 723 } 724 } 719 725 720 726 $html .= $subclass_user_interface; -
trunk/wifidog-auth/wifidog/classes/Content/EmbeddedContent.php
r600 r601 104 104 $html .= "</div>\n"; 105 105 106 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; // onclick='submit();'106 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 107 107 $html .= "</div>\n"; 108 108 } … … 125 125 $html .= "<div class='admin_section_tools'>\n"; 126 126 $name = "fallback_content_".$this->id."_fallback_content_erase"; 127 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; // onclick='submit();'127 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 128 128 $html .= "</div>\n"; 129 129 } -
trunk/wifidog-auth/wifidog/classes/Content/Langstring.php
r593 r601 164 164 $html .= "<div class='admin_section_tools'>\n"; 165 165 $name = "langstrings_".$this->id."_substring_$value[langstring_entries_id]_erase"; 166 $html .= "<input type='submit' name='$name' value='"._("Delete string")."' onclick='submit();'>";166 $html .= "<input type='submit' name='$name' value='"._("Delete string")."'>"; 167 167 $html .= "</div>\n"; 168 168 $html .= "</li>\n"; … … 189 189 190 190 $new_substring_submit_name = "langstrings_".$this->id."_add_new_entry"; 191 $html .= "<input type='submit' name='$new_substring_submit_name' value='"._("Add new string")."' onclick='submit();'>";191 $html .= "<input type='submit' name='$new_substring_submit_name' value='"._("Add new string")."'>"; 192 192 $html .= "</div>\n"; 193 193 $html .= "</li>\n"; -
trunk/wifidog-auth/wifidog/classes/Content/PatternLanguage.php
r588 r601 25 25 */ 26 26 require_once BASEPATH.'classes/Content/ContentGroup.php'; 27 require_once BASEPATH.'classes/User.php'; 27 28 28 29 /** Pattern Language is a location-aware fiction project by Kate Armstrong that attaches patterns of narrative to individuals as they move through the city of Montreal. Each person's path is logged in the system and compiled into a document that can be read online. The work is meant to engage with the rhythms of the city: by evolving according to the patterns of an individual, each story forms both a map or trace of movement and a fabric of sound. … … 44 45 $this->setIsExpandable(false); 45 46 } 47 48 /** Retreives the user interface of this object. Anything that overrides this method should call the parent method with it's output at the END of processing. 49 * @param $subclass_admin_interface Html content of the interface element of a children 50 * @return The HTML fragment for this interface */ 51 52 //TODO: complete this 53 /* 54 public function getUserUI($subclass_user_interface = null) 55 { 56 $html = ''; 57 $html .= "<div class='user_ui_container'>\n"; 58 $html .= "<div class='user_ui_object_class'>PatternLanguage (".get_class($this)." instance)</div>\n"; 59 60 // Check if the user has already subscribed to Pattern language 61 $current_user = User::getCurrentUser(); 62 if($current_user == null || $this->isUserSubscribed($current_user) == false) 63 { 64 // hyperlink to all users narrative 65 66 // Until subscription is done DO NOT log this ! 67 $this->setLoggingStatus(false); 68 // Tell the content group not to display elements until subscription is done 69 $parent_output = parent :: getUserUI($html, true); 70 } 71 else 72 { 73 // The user is subscribed to the pattern language show an element ! 74 // hyperlink to user's narrative 75 76 // Display the random pattern 77 $parent_output = parent :: getUserUI($html); 78 } 79 80 $html .= $subclass_user_interface; 81 $html .= "</div>\n"; 82 83 return $parent_output; 84 }*/ 46 85 47 86 /** Display the narrative -
trunk/wifidog-auth/wifidog/classes/ContentGroupElement.php
r593 r601 142 142 $html .= "<div class='admin_section_tools'>\n"; 143 143 $name = "content_group_element_".$this->id."_allowed_node_".$node->GetId()."_remove"; 144 $html .= "<input type='submit' name='$name' value='"._("Remove")."' onclick='submit();'>";144 $html .= "<input type='submit' name='$name' value='"._("Remove")."'>"; 145 145 $html .= "</div>\n"; 146 146 $html .= "</li>\n"; … … 155 155 $html .= Node :: getSelectNodeUI($name, $sql_additional_where); 156 156 $name = "content_group_element_{$this->id}_new_allowed_node_submit"; 157 $html .= "<input type='submit' name='$name' value='"._("Add new allowed node")."' onclick='submit();'>";157 $html .= "<input type='submit' name='$name' value='"._("Add new allowed node")."'>"; 158 158 $html .= "</li'>\n"; 159 159 … … 168 168 $html .= "<b>"._("Add a new displayed content OR select an existing one")."</b><br>"; 169 169 $html .= self :: getNewContentUI("content_group_element_{$this->id}_new_displayed_content")."<br>"; 170 $html .= self :: getSelectContentUI("content_group_element_{$this->id}_new_displayed_existing_element" );170 $html .= self :: getSelectContentUI("content_group_element_{$this->id}_new_displayed_existing_element", "AND content_id != '$this->id'"); 171 171 $html .= "<input type='submit' name='content_group_element_{$this->id}_new_displayed_existing_element_add' value='"._("Add")."'>"; 172 172 } … … 177 177 $html .= "<div class='admin_section_tools'>\n"; 178 178 $name = "content_group_element_{$this->id}_erase_displayed_content"; 179 $html .= "<input type='submit' name='$name' value='"._("Delete")."' onclick='submit();'>";179 $html .= "<input type='submit' name='$name' value='"._("Delete")."'>"; 180 180 $html .= "</div>\n"; 181 181 } -
trunk/wifidog-auth/wifidog/classes/Network.php
r600 r601 207 207 $html .= "<div class='admin_section_tools'>\n"; 208 208 $name = "content_group_".$this->id."_element_".$content->GetId()."_erase"; 209 $html .= "<input type='submit' name='$name' value='"._("Remove")."' onclick='submit();'>";209 $html .= "<input type='submit' name='$name' value='"._("Remove")."'>"; 210 210 $html .= "</div>\n"; 211 211 $html .= "</li>\n"; … … 215 215 $html .= Content :: getSelectContentUI($name, "AND content_id NOT IN (SELECT content_id FROM network_has_content WHERE network_id='$this->id')"); 216 216 $name = "network_{$this->id}_new_content_submit"; 217 $html .= "<input type='submit' name='$name' value='"._("Add")."' onclick='submit();'>";217 $html .= "<input type='submit' name='$name' value='"._("Add")."'>"; 218 218 $html .= "</li>\n"; 219 219 $html .= "</ul>\n"; … … 227 227 { 228 228 $user = User::getCurrentUser(); 229 if (!$ this->isOwner($user) && !$user->isSuperAdmin())229 if (!$user->isSuperAdmin()) 230 230 { 231 231 throw new Exception(_('Access denied!')); -
trunk/wifidog-auth/wifidog/classes/Node.php
r600 r601 354 354 $html .= "<div class='admin_section_tools'>\n"; 355 355 $name = "node_".$this->id."_content_".$content->GetId()."_erase"; 356 $html .= "<input type='submit' name='$name' value='"._("Remove")."' onclick='submit();'>";356 $html .= "<input type='submit' name='$name' value='"._("Remove")."'>"; 357 357 $html .= "</div>\n"; 358 358 $html .= "</li>\n"; … … 362 362 $html .= Content :: getSelectContentUI($name, "AND content_id NOT IN (SELECT content_id FROM node_has_content WHERE node_id='$this->id')"); 363 363 $name = "node_{$this->id}_new_content_submit"; 364 $html .= "<input type='submit' name='$name' value='"._("Add")."' onclick='submit();'>";364 $html .= "<input type='submit' name='$name' value='"._("Add")."'>"; 365 365 $html .= "</li>\n"; 366 366 $html .= "</ul>\n";
