81 return Query::create(
SectionContent,
"WHERE section_id=:section_id AND identifier=:identifier")
85 catch(DataNotFoundException $e)
133 checkNumeric(
$_POST[
"content"]);
135 if (isset(
$_POST[
"content"]))
139 $doomed->delete(
"WHERE section_content_id=$id");
143 if (isset(
$_POST[
"available"]))
162 $contentByIdentifier = reindexList(
$content,
"identifier");
169 $contentTree =
new TreeControl(
"section_content_tree",
"Section Content");
170 $contentTree->scroll =
true;
171 $contentTree->width = 360;
172 $contentTree->height = 430;
173 $contentTree->selectOnRightClick =
true;
175 $availableTree =
new TreeControl(
"available_content_tree",
"Available Content");
176 $availableTree->scroll =
true;
177 $availableTree->width = 360;
178 $availableTree->height = 430;
180 $categories = array();
184 $category =
new TreeNode(
"content_type_".codify(
$type),
$type,
null,
false,
"tree_node_closed",
"tree_node_open");
186 $categories[
$type] =
new TreeNode(
"category_".codify(
$type),
$type,
null,
false,
"tree_node_closed",
"tree_node_open");
190 if (array_key_exists($item->identifier, $contentByIdentifier))
continue;
192 $child =
new TreeNode(
"available[{$item->identifier}]", $item->identifier, $item->identifier,
false,
"plain_tree_closed",
"plain_tree_open");
193 $child->leafStyle =
"file_node_leaf";
195 $category->add($child);
198 $availableTree->add($category);
203 if (!array_key_exists($item->identifier,
$types))
continue;
206 $properties = $contentByIdentifier[$item->identifier];
208 $child =
new TreeNode(
"content['{$item->identifier}']", $item->identifier, $item->section_content_id,
false,
"plain_tree_closed",
"plain_tree_open");
209 $child->leafStyle = ($properties->template || $properties->role || $properties->permissions || $properties->use_SSL) ?
"flagged_node_leaf" :
"file_node_leaf";
210 $categories[
$type]->add($child);
213 foreach($categories as $category)
215 $contentTree->add($category);
219 <script src=
"/fakoli/js/section_content_manager.js" type=
"text/javascript"></script>
220 <script type=
"text/javascript">
222 var sectionContentManager;
224 window.addEvent(
"domready",
function()
232 $contextMenu =
new ContextMenu(
"section_content_menu",
"#section_content_tree_table");
233 $contextMenu->command(
"set_template",
"Set Template...",
"sectionContentManager.setTemplate()",
false)
234 ->command(
"set_roles",
"Set Roles...",
"sectionContentManager.setRole()",
false)
235 ->command(
"set_permissions",
"Set Permissions...",
"sectionContentManager.setPermissions()",
false)
236 ->command(
"set_ssl",
"Configure SSL...",
"sectionContentManager.setSSL()",
false)
237 ->command(
"set_page_title",
"Override Page Title...",
"sectionContentManager.setPageTitle()",
false)
238 ->command(
"set_body_class",
"Set Body Class...",
"sectionContentManager.setBodyClass()",
false)
239 ->command(
"set_all",
"All Properties...",
"sectionContentManager.allProperties()",
"",
false)
241 ->command(
"use_defaults",
"Use Section Defaults",
"sectionContentManager.clearProperties()",
"",
false)
243 ->command(
"position_modules",
"Position Modules",
"sectionContentManager.positionModules()",
"",
false);
245 $script .= $contextMenu->writeScript();
246 $dialogs .= $contextMenu->writeMenu();
249 <form method=
"POST" action=
"?section_id=<?echo $this->section->section_id?>">
250 <div
style=
"float: left; width: 365px; margin-left: 10px">
251 <? $contentTree->writeHTML()?>
253 <div
id=
"section_content_buttons">
254 <button
class=
"button" id=
"section_move_left" title=
"Add"></button>
255 <button
class=
"button" id=
"section_move_right" title=
"Remove"></button>
257 <div
style=
"float: left; width: 365px">
258 <? $availableTree->writeHTML()?>
260 <div
style=
"clear: left"><br/></div>
static fireEvent($event, $parameter=null, $mustBeConsumed=false)
Fire an event to all subscribers as detailed in their manifests.
FakoliEventNotConsumed is thrown when no subscriber has handled an event that was fired with $mustBeC...
FakoliException is the base exception class for all Fakoli errors.
categorizeItemTypes($itemsByType)
getAdminView($section)
Factory method to build the view class for displaying and manipulating section content for the specif...
getDefaultPage($section)
Returns the identifier for the default page in the section (i.e.
sendContent($section, $identifier)
Renders and sends the specified content for the given section.
getContent($section, $identifier)
Returns a SectionContent object for the specified section and identifier.
Defines the interface required by a SectionContentManager.
sendContent($section, $identifier)
Renders and sends the specified content for the given section.
getDefaultPage($section)
Returns the identifier for the default page in the section (i.e.
getAdminView($section)
Factory method to build the view class for displaying and manipulating section content for the specif...
getContent($section, $identifier)
Returns a SectionContent object for the specified section and identifier.
if(array_key_exists("HTTP_IF_MODIFIED_SINCE", $_SERVER)) $content