----------------------------------------------------------------------------
-- AXYL CORE INITIAL DATA
-- POSTGRES VARIANT

-- SYSCONTROL (default) CONFIGURATION FIELDS
insert into ax_config (config_name,config_fields)
values ('sys_control','a:4:{s:11:"Lucene_Host";O:11:"configfield":4:{s:4:"name";s:11:"Lucene_Host";s:4:"type";s:4:"text";s:4:"list";s:0:"";s:7:"default";s:0:"";}s:11:"Lucene_Port";O:11:"configfield":4:{s:4:"name";s:11:"Lucene_Port";s:4:"type";s:4:"text";s:4:"list";s:0:"";s:7:"default";s:0:"";}s:20:"Lucene_Site_Indexing";O:11:"configfield":4:{s:4:"name";s:20:"Lucene_Site_Indexing";s:4:"type";s:4:"bool";s:4:"list";s:0:"";s:7:"default";b:0;}s:15:"Max_Latest_News";O:11:"configfield":4:{s:4:"name";s:15:"Max_Latest_News";s:4:"type";s:4:"text";s:4:"list";s:0:"";s:7:"default";s:1:"3";}}');
insert into ax_configuration (config_name,config_id,config_set)
values ('sys_control','default','a:4:{s:11:"Lucene_Host";s:9:"localhost";s:11:"Lucene_Port";s:5:"22222";s:20:"Lucene_Site_Indexing";b:1;s:15:"Max_Latest_News";s:1:"3";}');

-- LANGUAGES
insert into ax_language (lang_id,lang_desc,char_encoding,direction,is_default,display_order,enabled) values (0,'default','','LTR','t',0,'t');

-- SITEPAGES
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (1, 'Home','/index.php','t','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (2, 'Preferences','/axyl-prefs.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (3, 'About','/about.php','t','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (4, 'Forums','/axyl-forums.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (5, 'Organisations','/axyl-orgs.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (6, 'Users','/axyl-users.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (7, 'Groups','/axyl-ugroups.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (8, 'Menu Builder','/axyl-menu.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (9, 'Query Builder','/axyl-queries.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (10,'Media Catalog','/axyl-catalog.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (11,'Webpage Control','/axyl-sitepages.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (12,'Languages','/axyl-languages.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (13,'News','/axyl-news.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (14,'News Editor','/axyl-story-admin.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (15,'News Categories','/axyl-story-categories.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (16,'Content Locations','/axyl-locations.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (17,'Login','/axyl-login.php','f','t');
insert into ax_sitepage (page_id,page_title,page_path,managed,enabled) values (99,'System Setup','/axyl-system.php','f','t');

-- MENU & OPTIONS
insert into ax_menu (menu_id,menu_name,lang_id,menu_desc,menu_user_groups,active) values (1,'main',0,'Main Menu','','t');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1, 1,'f', 0,'','',0,'HOME','Homepage',1,'/index.php','f','t',70,20,'index.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1, 2,'f', 0,'Admin,User,Editor','',0,'PREFERENCES','Set your preferences',2,'/axyl-prefs.php','t','t',120,20,'axyl-prefs.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1, 3,'f', 0,'','',0,'ABOUT','About this site',3,'/about.php','f','t',70,20,'about.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1, 4,'f', 0,'','',0,'FORUMS','Forums',4,'/axyl-forums.php','f','t',90,20,'axyl-forums.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1, 5,'f', 0,'','',0,'NEWS','Latest news',4,'/axyl-news.php','f','t',70,20,'axyl-news.php','');

insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,10,'t', 0,'Admin,Editor','',0,'MAINTENANCE','Maintenance',5,'','f','t',70,20,'','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,11,'f',10,'Admin',       '',1,'ORGANISATIONS','Setup organisations',1,'/axyl-orgs.php','f','t',130,20,'axyl-orgs.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,12,'f',10,'Admin',       '',1,'USERS','Setup users',2,'/axyl-users.php','f','t',70,20,'axyl-users.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,13,'f',10,'Admin',       '',1,'GROUPS','Setup groups',3,'/axyl-ugroups.php','f','t',80,20,'axyl-ugroups.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,14,'f',10,'Admin,Editor','',1,'MENUS','Menu builder',4,'/axyl-menu.php','f','t',70,20,'axyl-menu.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,15,'f',10,'Admin,Editor','',1,'QUERIES','Query builder',5,'/axyl-queries.php','f','t',80,20,'axyl-queries.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,16,'f',10,'Admin,Editor','',1,'MEDIA','Media catalog',6,'/axyl-catalog.php','f','t',70,20,'axyl-catalog.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,17,'f',10,'Admin,Editor','',1,'WEBPAGES','Webpage control',7,'/axyl-sitepages.php','f','t',90,20,'axyl-sitepages.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,18,'f',10,'Admin,Editor','',1,'LANGUAGES','Language support',8,'/axyl-languages.php','f','t',100,20,'axyl-languages.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,19,'t',10,'Admin,Editor','',1,'NEWS','News administration',9,'','f','t',70,20,'','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,20,'f',19,'Admin,Editor','',2,'News Editor','Create edit and delete stories',1,'/axyl-story-admin.php','f','t',120,20,'/axyl-story-admin.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,21,'f',19,'Admin,Editor','',2,'Categories','Manage news categories',2,'/axyl-story-categories.php','f','t',110,20,'/axyl-story-categories.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,22,'f',19,'Admin,Editor','',2,'Locations','Manage content locations',3,'/axyl-locations.php','f','t',100,20,'/axyl-locations.php','');
insert into ax_menuoption (menu_id,menuoption_id,is_parent,parent_id,user_groups,user_type,menu_level,label,description,display_order,action,auth_code,active,width,height,sitepage,sitepage_parms)
values (1,99,'f',10,'Admin',       '',1,'SETUP','System setup',99,'/axyl-system.php','f','t',70,20,'axyl-system.php','');

-- Pre-defined Axyl groups - do not remove any of these.
insert into ax_group (group_id,group_desc) values (0,'Guest');
insert into ax_group (group_id,group_desc) values (1,'Admin');
insert into ax_group (group_id,group_desc) values (2,'User');
insert into ax_group (group_id,group_desc) values (3,'Editor');
insert into ax_group (group_id,group_desc) values (4,'Author');
insert into ax_group (group_id,group_desc) values (5,'Entry');

-- Pre-defined Axyl usergroups - do not remove any of these.
insert into ax_user_group (user_id,group_id) values ('guest',0);
insert into ax_user_group (user_id,group_id) values ('axyl',1);
insert into ax_user_group (user_id,group_id) values ('ed',3);

-- SITEPAGE SECURITY
-- Organisation maint
insert into ax_sitepage_group (page_id,group_id) values(5,1);
-- User maint
insert into ax_sitepage_group (page_id,group_id) values(6,1);
-- Group maint
insert into ax_sitepage_group (page_id,group_id) values(7,1);
-- Menu builder
insert into ax_sitepage_group (page_id,group_id) values(8,1);
insert into ax_sitepage_group (page_id,group_id) values(8,3);
-- Query builder
insert into ax_sitepage_group (page_id,group_id) values(9,1);
insert into ax_sitepage_group (page_id,group_id) values(9,3);
-- Media catalog
insert into ax_sitepage_group (page_id,group_id) values(10,1);
insert into ax_sitepage_group (page_id,group_id) values(10,3);
-- Sitepage maint
insert into ax_sitepage_group (page_id,group_id) values(11,1);
insert into ax_sitepage_group (page_id,group_id) values(11,3);
-- Languages maint
insert into ax_sitepage_group (page_id,group_id) values(12,1);
insert into ax_sitepage_group (page_id,group_id) values(12,3);
-- Story Admin
insert into ax_sitepage_group (page_id,group_id) values(14,1);
insert into ax_sitepage_group (page_id,group_id) values(14,3);
-- Content Locations
insert into ax_sitepage_group (page_id,group_id) values(15,1);
insert into ax_sitepage_group (page_id,group_id) values(15,3);
-- Story Categories
insert into ax_sitepage_group (page_id,group_id) values(16,1);
insert into ax_sitepage_group (page_id,group_id) values(16,3);
-- System setup
insert into ax_sitepage_group (page_id,group_id) values(99,1);

-- CONTENT LOCATIONS
insert into ax_content_location (location_id, location_name, enabled, location_desc)
values (1, 'Latest News', true, 'News items which will be listed in the latest news sections - usually in the right sidebar.');
insert into ax_content_location (location_id, location_name, enabled, location_desc)
values (2, 'Featured News Item', true, 'News items which will appear on the front (index) page of the website.');

-- STORY CATEGORIES
insert into ax_story_category (category_id, category_desc, has_media, has_precis, has_expiry, has_multilang, has_multimedia)
values (1, 'General News', true, true, true, true, false);

-- STORY CATEGORY DEFAULT LOCATIONS
insert into ax_story_category_locs (category_id, location_id) values (1, 1);
insert into ax_story_category_locs (category_id, location_id) values (1, 2);

-- END