CMS  Version 3.9
section_map.inc
Go to the documentation of this file.
1 <?php
2 Fakoli::using("developer_tools", "section");
3 Fakoli::usingFeature("grouped_data_view");
4 
5 $page_title = "Section Content Map";
6 $menu_item = "Section Map";
7 
8 $site_id = checkNumeric($_GET["site_id"]);
9 
10 $sites = query(Site, "ORDER BY site_name");
11 
12 
13 if (!$site_id) $site_id = $sites[0]->site_id;
14 
15 $tabs = new DataItemTabBar("tabs", $sites);
16 
17 $sections = Query::create(Section, "WHERE site_id=:s ORDER BY section")
18  ->bind(":s", $site_id)
19  ->execute();
20 
21 $itemsByType = IndexedQuery::create(SectionContent, "WHERE section_id IN (SELECT section_id FROM section WHERE site_id=:s) ORDER BY identifier", "section_id")
22  ->bind(":s", $site_id)
23  ->execute();
24 
25 $table = new GroupedDataListView($itemsByType, "items_by_type");
26 $table->column("Identifier", "<strong>{identifier}</strong>", true, "width: 20%")
27  ->column("Roles", "{role:/,/, /}", true, "width: 40%")
28  ->column("Permissions", "{permissions:/,/, /}", true)
29  ->column("Template", "{template}", true)
30  ->column("SSL", "{use_SSL:Yes/No}", true);
31 
32 foreach($sections as $section)
33 {
34  $table->group(($section->section == '/') ? "Top Level" : $section->section, $section->section_id);
35 }
36 
37 $table->mode = "tree";
38 $table->groupAsWorksheets = true;
39 $table->filter = true;
40 $table->sortable = true;
41 $table->excelFile = codify($config['sitename']."_section_map").".xls";
42 
43 $script .= $table->writeScript();
44 
45 $tabs->writeHTML();
46 ?>
47 <div class='tab_border'>
48 <?
49 $table->drawView();
50 ?>
51 </div>
$section
Definition: event_form.inc:44
static usingFeature()
Uses the specified framework feature(s).
Definition: core.inc:388
static using()
Import the datamodels, views and manifest for the specified component(s).
Definition: core.inc:116
Section DataItem, defining the data model for sections within a site.
Definition: section.inc:45
Definition: site.inc:40
global $config
Definition: import.inc:4
$sites
Definition: section_map.inc:10
$tabs
Definition: section_map.inc:15
$menu_item
Definition: section_map.inc:6
$site_id
Definition: section_map.inc:8
$itemsByType
Definition: section_map.inc:21
$page_title
Definition: section_map.inc:5
$sections
Definition: section_map.inc:17
$table
Definition: section_map.inc:25
$script
Definition: section_map.inc:43