| 957 | | $html .= "<div class='admin_section_container'>\n"; |
| 958 | | $html .= "<div class='admin_section_title'>"._("Node content:")."</div>\n"; |
| 959 | | |
| 960 | | $html .= "<ul class='admin_section_list'>\n"; |
| 961 | | foreach ($this->getAllContent() as $content) |
| 962 | | { |
| 963 | | $html .= "<li class='admin_section_list_item'>\n"; |
| 964 | | $html .= "<div class='admin_section_data'>\n"; |
| 965 | | $html .= $content->getListUI(); |
| 966 | | $html .= "</div>\n"; |
| 967 | | $html .= "<div class='admin_section_tools'>\n"; |
| 968 | | $name = "node_".$this->id."_content_".$content->GetId()."_edit"; |
| 969 | | $html .= "<input type='button' name='$name' value='"._("Edit")."' onClick='window.location.href = \"".GENERIC_OBJECT_ADMIN_ABS_HREF."?object_class=Content&action=edit&object_id=".$content->GetId()."\";'>\n"; |
| 970 | | $name = "node_".$this->id."_content_".$content->GetId()."_erase"; |
| 971 | | $html .= "<input type='submit' name='$name' value='"._("Remove")."'>"; |
| 972 | | $html .= "</div>\n"; |
| 973 | | $html .= "</li>\n"; |
| 974 | | } |
| 975 | | $html .= "<li class='admin_section_list_item'>\n"; |
| 976 | | $name = "node_{$this->id}_new_content"; |
| 977 | | $html .= Content :: getSelectContentUI($name, "AND content_id NOT IN (SELECT content_id FROM node_has_content WHERE node_id='$this->id')"); |
| 978 | | $name = "node_{$this->id}_new_content_submit"; |
| 979 | | $html .= "<input type='submit' name='$name' value='"._("Add")."'>"; |
| 980 | | $html .= "</li>\n"; |
| 981 | | $html .= "</ul>\n"; |
| | 957 | /* Node content */ |
| | 958 | $html .= "<div class='admin_section_container'>\n"; |
| | 959 | $html .= "<div class='admin_section_title'>"._("Node content (login):")."</div>\n"; |
| | 960 | $name = "node_{$this->id}_content_login"; |
| | 961 | $html .= Content::getLinkedContentUI($name, 'node_has_content', 'node_id', $this->id, $display_location = 'login_page'); |
| | 962 | $html .= "</div>\n"; |
| | 963 | |
| | 964 | $html .= "<div class='admin_section_container'>\n"; |
| | 965 | $html .= "<div class='admin_section_title'>"._("Node content (portal):")."</div>\n"; |
| | 966 | $name = "node_{$this->id}_content_portal"; |
| | 967 | $html .= Content::getLinkedContentUI($name, 'node_has_content', 'node_id', $this->id, $display_location = 'portal_page'); |
| 1171 | | // Rebuild content id and deleting if it was selected for deletion ) |
| 1172 | | foreach ($this->getAllContent() as $content) |
| 1173 | | { |
| 1174 | | $name = "node_".$this->id."_content_".$content->GetId()."_erase"; |
| 1175 | | if (!empty ($_REQUEST[$name])) |
| 1176 | | { |
| 1177 | | $this->removeContent($content); |
| 1178 | | } |
| 1179 | | } |
| 1180 | | |
| 1181 | | $name = "node_{$this->id}_new_content_submit"; |
| 1182 | | if (!empty ($_REQUEST[$name])) |
| 1183 | | { |
| 1184 | | $name = "node_{$this->id}_new_content"; |
| 1185 | | $content = Content :: processSelectContentUI($name); |
| 1186 | | if ($content) |
| 1187 | | $this->addContent($content); |
| 1188 | | } |
| | 1157 | $name = "node_{$this->id}_content_login"; |
| | 1158 | Content::processLinkedContentUI($name, 'node_has_content', 'node_id', $this->id); |
| | 1159 | $name = "node_{$this->id}_content_portal"; |
| | 1160 | Content::processLinkedContentUI($name, 'node_has_content', 'node_id', $this->id); |
| | 1161 | |